diff --git a/PKG-INFO b/PKG-INFO
index 97d5202fa8bf26e6616c5874fc39bee77f3ecd36..3174227692591f351afae5bdcb41e50903b5b183 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.2
 Name: numpy
-Version: 1.16.0
+Version: 1.16.1
 Summary:  NumPy is the fundamental package for array computing with Python.
 Home-page: https://www.numpy.org
 Author: NumPy Developers
diff --git a/benchmarks/benchmarks/bench_overrides.py b/benchmarks/benchmarks/bench_overrides.py
index 155d44fa968a73164939105a6fde0335a83522c7..58572d07d05066112e56bc41cca6af956e2b65fe 100644
--- a/benchmarks/benchmarks/bench_overrides.py
+++ b/benchmarks/benchmarks/bench_overrides.py
@@ -24,10 +24,10 @@ def mock_broadcast_to(array, shape, subok=False):
 
 
 def _concatenate_dispatcher(arrays, axis=None, out=None):
-    for array in arrays:
-        yield array
     if out is not None:
-        yield out
+        arrays = list(arrays)
+        arrays.append(out)
+    return arrays
 
 
 @array_function_dispatch(_concatenate_dispatcher)
diff --git a/doc/changelog/1.16.1-changelog.rst b/doc/changelog/1.16.1-changelog.rst
new file mode 100644
index 0000000000000000000000000000000000000000..aaa803c1486732aee0c5cc4f17370ace423f6898
--- /dev/null
+++ b/doc/changelog/1.16.1-changelog.rst
@@ -0,0 +1,62 @@
+
+Contributors
+============
+
+A total of 16 people contributed to this release.  People with a "+" by their
+names contributed a patch for the first time.
+
+* Antoine Pitrou
+* Arcesio Castaneda Medina +
+* Charles Harris
+* Chris Markiewicz +
+* Christoph Gohlke
+* Christopher J. Markiewicz +
+* Daniel Hrisca +
+* EelcoPeacs +
+* Eric Wieser
+* Kevin Sheppard
+* Matti Picus
+* OBATA Akio +
+* Ralf Gommers
+* Sebastian Berg
+* Stephan Hoyer
+* Tyler Reddy
+
+Pull requests merged
+====================
+
+A total of 32 pull requests were merged for this release.
+
+* `#12754 <https://github.com/numpy/numpy/pull/12754>`__: BUG: Check paths are unicode, bytes or path-like
+* `#12767 <https://github.com/numpy/numpy/pull/12767>`__: ENH: add mm->q floordiv
+* `#12768 <https://github.com/numpy/numpy/pull/12768>`__: ENH: port np.core.overrides to C for speed
+* `#12769 <https://github.com/numpy/numpy/pull/12769>`__: ENH: Add np.ctypeslib.as_ctypes_type(dtype), improve `np.ctypeslib.as_ctypes`
+* `#12771 <https://github.com/numpy/numpy/pull/12771>`__: BUG: Ensure probabilities are not NaN in choice
+* `#12772 <https://github.com/numpy/numpy/pull/12772>`__: MAINT: add warning to numpy.distutils for LDFLAGS append behavior.
+* `#12773 <https://github.com/numpy/numpy/pull/12773>`__: ENH: add "max difference" messages to np.testing.assert_array_equal...
+* `#12774 <https://github.com/numpy/numpy/pull/12774>`__: BUG: Fix incorrect/missing reference cleanups found using valgrind
+* `#12776 <https://github.com/numpy/numpy/pull/12776>`__: BUG,TST: Remove the misguided `run_command` that wraps subprocess
+* `#12777 <https://github.com/numpy/numpy/pull/12777>`__: DOC, TST: Clean up matplotlib imports
+* `#12781 <https://github.com/numpy/numpy/pull/12781>`__: BUG: Fix reference counting for subarrays containing objects
+* `#12782 <https://github.com/numpy/numpy/pull/12782>`__: BUG: Ensure failing memory allocations are reported
+* `#12784 <https://github.com/numpy/numpy/pull/12784>`__: BUG: Fix leak of void scalar buffer info
+* `#12788 <https://github.com/numpy/numpy/pull/12788>`__: MAINT: Change the order of checking for local file.
+* `#12808 <https://github.com/numpy/numpy/pull/12808>`__: BUG: loosen kwargs requirements in ediff1d
+* `#12809 <https://github.com/numpy/numpy/pull/12809>`__: DOC: clarify the extend of __array_function__ support in NumPy...
+* `#12810 <https://github.com/numpy/numpy/pull/12810>`__: BUG: Check that dtype or formats arguments are not None.
+* `#12811 <https://github.com/numpy/numpy/pull/12811>`__: BUG: fix f2py problem to build wrappers using PGI's Fortran
+* `#12812 <https://github.com/numpy/numpy/pull/12812>`__: BUG: double decref of dtype in failure codepath. Test and fix
+* `#12813 <https://github.com/numpy/numpy/pull/12813>`__: BUG, DOC: test, fix that f2py.compile accepts str and bytes,...
+* `#12816 <https://github.com/numpy/numpy/pull/12816>`__: BUG: resolve writeback in arr_insert failure paths
+* `#12820 <https://github.com/numpy/numpy/pull/12820>`__: ENH: Add mm->qm divmod
+* `#12843 <https://github.com/numpy/numpy/pull/12843>`__: BUG: fix to check before apply `shlex.split`
+* `#12844 <https://github.com/numpy/numpy/pull/12844>`__: BUG: Fix SystemError when pickling datetime64 array with pickle5
+* `#12845 <https://github.com/numpy/numpy/pull/12845>`__: BUG: Fix rounding of denormals in double and float to half casts.
+* `#12868 <https://github.com/numpy/numpy/pull/12868>`__: TEST: pin mingw version
+* `#12869 <https://github.com/numpy/numpy/pull/12869>`__: BUG: ndarrays pickled by 1.16 cannot be loaded by 1.15.4 and...
+* `#12870 <https://github.com/numpy/numpy/pull/12870>`__: BUG: do not Py_DECREF NULL pointer
+* `#12890 <https://github.com/numpy/numpy/pull/12890>`__: ENH: add _dtype_ctype to namespace for freeze analysis
+* `#12891 <https://github.com/numpy/numpy/pull/12891>`__: BUG: fail if old multiarray module detected
+* `#12898 <https://github.com/numpy/numpy/pull/12898>`__: BUG: Do not double-quote arguments passed on to the linker
+* `#12899 <https://github.com/numpy/numpy/pull/12899>`__: BUG: Do not insert extra double quote into preprocessor macros
+* `#12902 <https://github.com/numpy/numpy/pull/12902>`__: DOC: Prepare for 1.16.1 release.
diff --git a/doc/neps/nep-0018-array-function-protocol.rst b/doc/neps/nep-0018-array-function-protocol.rst
index 988c9086a631d5bda3892a6ef1925be0b1a71244..ffe780c795fadcbeb79e7cf65135828871f27488 100644
--- a/doc/neps/nep-0018-array-function-protocol.rst
+++ b/doc/neps/nep-0018-array-function-protocol.rst
@@ -340,7 +340,7 @@ Changes within NumPy functions
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 Given a function defining the above behavior, for now call it
-``array_function_implementation_or_override``, we now need to call that
+``implement_array_function``, we now need to call that
 function from within every relevant NumPy function. This is a pervasive change,
 but of fairly simple and innocuous code that should complete quickly and
 without effect if no arguments implement the ``__array_function__``
@@ -358,7 +358,7 @@ functions:
             @functools.wraps(implementation)
             def public_api(*args, **kwargs):
                 relevant_args = dispatcher(*args, **kwargs)
-                return array_function_implementation_or_override(
+                return implement_array_function(
                     implementation, public_api, relevant_args, args, kwargs)
             return public_api
         return decorator
@@ -395,11 +395,11 @@ It's particularly worth calling out the decorator's use of
 
 In a few cases, it would not make sense to use the ``array_function_dispatch``
 decorator directly, but override implementation in terms of
-``array_function_implementation_or_override`` should still be straightforward.
+``implement_array_function`` should still be straightforward.
 
 - Functions written entirely in C (e.g., ``np.concatenate``) can't use
   decorators, but they could still use a C equivalent of
-  ``array_function_implementation_or_override``. If performance is not a
+  ``implement_array_function``. If performance is not a
   concern, they could also be easily wrapped with a small Python wrapper.
 - ``np.einsum`` does complicated argument parsing to handle two different
   function signatures. It would probably be best to avoid the overhead of
@@ -475,7 +475,7 @@ the difference in speed between the ``ndarray.sum()`` method (1.6 us) and
 ``numpy.sum()`` function (2.6 us).
 
 Fortunately, we expect significantly less overhead with a C implementation of
-``array_function_implementation_or_override``, which is where the bulk of the
+``implement_array_function``, which is where the bulk of the
 runtime is. This would leave the ``array_function_dispatch`` decorator and
 dispatcher function on their own adding about 0.5 microseconds of overhead,
 for perhaps ~1 microsecond of overhead in the typical case.
@@ -503,7 +503,7 @@ already wrap a limited subset of SciPy functionality (e.g.,
 
 If we want to do this, we should expose at least the decorator
 ``array_function_dispatch()`` and possibly also the lower level
-``array_function_implementation_or_override()`` as part of NumPy's public API.
+``implement_array_function()`` as part of NumPy's public API.
 
 Non-goals
 ---------
@@ -807,7 +807,7 @@ public API.
 
 ``types`` is included because we can compute it almost for free as part of
 collecting ``__array_function__`` implementations to call in
-``array_function_implementation_or_override``. We also think it will be used
+``implement_array_function``. We also think it will be used
 by many ``__array_function__`` methods, which otherwise would need to extract
 this information themselves. It would be equivalently easy to provide single
 instances of each type, but providing only types seemed cleaner.
@@ -823,7 +823,7 @@ There are two other arguments that we think *might* be important to pass to
 - Access to the non-dispatched implementation (i.e., before wrapping with
   ``array_function_dispatch``) in ``ndarray.__array_function__`` would allow
   us to drop special case logic for that method from
-  ``array_function_implementation_or_override``.
+  ``implement_array_function``.
 - Access to the ``dispatcher`` function passed into
   ``array_function_dispatch()`` would allow ``__array_function__``
   implementations to determine the list of "array-like" arguments in a generic
diff --git a/doc/release/1.16.0-notes.rst b/doc/release/1.16.0-notes.rst
index de636933f4c8e041483da79130818a096ff72176..341d5f71566dffd077f3e8c061777b153c994b28 100644
--- a/doc/release/1.16.0-notes.rst
+++ b/doc/release/1.16.0-notes.rst
@@ -20,7 +20,7 @@ easier going forward.
 Highlights
 ==========
 
-* Experimental support for overriding numpy functions,
+* Experimental (opt-in only) support for overriding numpy functions,
   see ``__array_function__`` below.
 
 * The ``matmul`` function is now a ufunc. This provides better
@@ -518,14 +518,16 @@ accessing invalid memory locations.
 
 NumPy functions now support overrides with ``__array_function__``
 -----------------------------------------------------------------
-It is now possible to override the implementation of almost all NumPy functions
-on non-NumPy arrays by defining a ``__array_function__`` method, as described
-in `NEP 18`_. The sole exception are functions for explicitly casting to NumPy
-arrays such as ``np.array``. As noted in the NEP, this feature remains
-experimental and the details of how to implement such overrides may change in
-the future.
+NumPy has a new experimental mechanism for overriding the implementation of
+almost all NumPy functions on non-NumPy arrays by defining an
+``__array_function__`` method, as described in `NEP 18`_.
+
+This feature is not yet been enabled by default, but has been released to
+facilitate experimentation by potential users. See the NEP for details on
+setting the appropriate environment variable. We expect the NumPy 1.17 release
+will enable overrides by default, which will also be more performant due to a
+new implementation written in C.
 
-.. _`NEP 15` : http://www.numpy.org/neps/nep-0015-merge-multiarray-umath.html
 .. _`NEP 18` : http://www.numpy.org/neps/nep-0018-array-function-protocol.html
 
 Arrays based off readonly buffers cannot be set ``writeable``
diff --git a/doc/release/1.16.1-notes.rst b/doc/release/1.16.1-notes.rst
new file mode 100644
index 0000000000000000000000000000000000000000..2483b1834cd2ed94d9e5e1e5f4023992b6c7546f
--- /dev/null
+++ b/doc/release/1.16.1-notes.rst
@@ -0,0 +1,107 @@
+==========================
+NumPy 1.16.1 Release Notes
+==========================
+
+The NumPy 1.16.1 release fixes bugs reported against the 1.16.0 release, and
+also backports several enhancements from master that seem appropriate for a
+release series that is the last to support Python 2.7. The wheels on PyPI are
+linked with OpenBLAS v0.3.4+,  which should fix the known threading issues
+found in previous OpenBLAS versions.
+
+Downstream developers building this release should use Cython >= 0.29.2 and, if
+using OpenBLAS, OpenBLAS > v0.3.4.
+
+If you are installing using pip, you may encounter a problem with older
+installed versions of NumPy that pip did not delete becoming mixed with the
+current version, resulting in an ``ImportError``. That problem is particularly
+common on Debian derived distributions due to a modified pip.  The fix is to
+make sure all previous NumPy versions installed by pip have been removed. See
+`#12736 <https://github.com/numpy/numpy/issues/12736>`__ for discussion of the
+issue. Note that previously this problem resulted in an ``AttributeError``.
+
+
+Contributors
+============
+
+A total of 16 people contributed to this release.  People with a "+" by their
+names contributed a patch for the first time.
+
+* Antoine Pitrou
+* Arcesio Castaneda Medina +
+* Charles Harris
+* Chris Markiewicz +
+* Christoph Gohlke
+* Christopher J. Markiewicz +
+* Daniel Hrisca +
+* EelcoPeacs +
+* Eric Wieser
+* Kevin Sheppard
+* Matti Picus
+* OBATA Akio +
+* Ralf Gommers
+* Sebastian Berg
+* Stephan Hoyer
+* Tyler Reddy
+
+
+Enhancements
+============
+
+* `#12767 <https://github.com/numpy/numpy/pull/12767>`__: ENH: add mm->q floordiv
+* `#12768 <https://github.com/numpy/numpy/pull/12768>`__: ENH: port np.core.overrides to C for speed
+* `#12769 <https://github.com/numpy/numpy/pull/12769>`__: ENH: Add np.ctypeslib.as_ctypes_type(dtype), improve `np.ctypeslib.as_ctypes`
+* `#12773 <https://github.com/numpy/numpy/pull/12773>`__: ENH: add "max difference" messages to np.testing.assert_array_equal...
+* `#12820 <https://github.com/numpy/numpy/pull/12820>`__: ENH: Add mm->qm divmod
+* `#12890 <https://github.com/numpy/numpy/pull/12890>`__: ENH: add _dtype_ctype to namespace for freeze analysis
+
+
+Compatibility notes
+===================
+
+* The changed error message emited by array comparison testing functions may
+  affect doctests. See below for detail.
+
+* Casting from double and single denormals to float16 has been corrected.  In
+  some rare cases, this may result in results being rounded up instead of down,
+  changing the last bit (ULP) of the result.
+
+
+New Features
+============
+
+divmod operation is now supported for two ``timedelta64`` operands
+------------------------------------------------------------------
+The divmod operator now handles two ``np.timedelta64`` operands, with
+type signature ``mm->qm``.
+
+
+Improvements
+============
+
+Further improvements to ``ctypes`` support in ``np.ctypeslib``
+--------------------------------------------------------------
+A new ``np.ctypeslib.as_ctypes_type`` function has been added, which can be
+used to converts a `dtype` into a best-guess `ctypes` type. Thanks to this
+new function, ``np.ctypeslib.as_ctypes`` now supports a much wider range of
+array types, including structures, booleans, and integers of non-native
+endianness.
+
+Array comparison assertions include maximum differences
+-------------------------------------------------------
+Error messages from array comparison tests such as
+`np.testing.assert_allclose` now include "max absolute difference" and
+"max relative difference," in addition to the previous "mismatch" percentage.
+This information makes it easier to update absolute and relative error
+tolerances.
+
+
+Changes
+=======
+
+``timedelta64 % 0`` behavior adjusted to return ``NaT``
+-------------------------------------------------------
+The modulus operation with two ``np.timedelta64`` operands now returns
+``NaT`` in the case of division by zero, rather than returning zero
+
+
+
diff --git a/doc/source/f2py/run_main_session.dat b/doc/source/f2py/run_main_session.dat
index b9a7e1b0d24f24e864071fdd5dd9cde7ed7bc843..be6cacd22634942d62d1b9dd2585c284efeaf5e0 100644
--- a/doc/source/f2py/run_main_session.dat
+++ b/doc/source/f2py/run_main_session.dat
@@ -8,7 +8,7 @@ Post-processing...
 Building modules...
         Building module "scalar"...
         Wrote C/API module "scalar" to file "./scalarmodule.c"
->>> printr(r)
+>>> print(r)
 {'scalar': {'h': ['/home/users/pearu/src_cvs/f2py/src/fortranobject.h'],
 	 'csrc': ['./scalarmodule.c', 
                   '/home/users/pearu/src_cvs/f2py/src/fortranobject.c']}}
diff --git a/doc/source/f2py/usage.rst b/doc/source/f2py/usage.rst
index 0f5068e0ed72adae078bdcca76cf993b33cf6936..5043ec43095889bbf2583ddd5131c497be1004fe 100644
--- a/doc/source/f2py/usage.rst
+++ b/doc/source/f2py/usage.rst
@@ -214,32 +214,7 @@ Python module ``numpy.f2py``
   The current Python interface to the ``f2py`` module is not mature and
   may change in the future.
 
-The following functions are provided by the ``numpy.f2py`` module:
 
-``run_main(<list>)``
-  Equivalent to running::
+.. automodule:: numpy.f2py
+    :members:
 
-    f2py <args>
-
-  where ``<args>=string.join(<list>,' ')``, but in Python.  Unless
-  ``-h`` is used, this function returns a dictionary containing
-  information on generated modules and their dependencies on source
-  files.  For example, the command ``f2py -m scalar scalar.f`` can be
-  executed from Python as follows
-
-  .. include:: run_main_session.dat
-     :literal:
-
-  You cannot build extension modules with this function, that is,
-  using ``-c`` is not allowed. Use ``compile`` command instead, see
-  below.
-
-``compile(source, modulename='untitled', extra_args='', verbose=1, source_fn=None)``
-  Build extension module from Fortran 77 source string ``source``.
-  Return 0 if successful.
-  Note that this function actually calls ``f2py -c ..`` from shell to
-  ensure safety of the current Python process.
-  For example,
-
-  .. include:: compile_session.dat
-    :literal:
diff --git a/doc/source/release.rst b/doc/source/release.rst
index 1cf2155498bbb9b21383d20a7a0fbb9377e4a011..ea582e2aaa5244d74cf3efc90382d0383f8a6764 100644
--- a/doc/source/release.rst
+++ b/doc/source/release.rst
@@ -2,6 +2,7 @@
 Release Notes
 *************
 
+.. include:: ../release/1.16.1-notes.rst
 .. include:: ../release/1.16.0-notes.rst
 .. include:: ../release/1.15.4-notes.rst
 .. include:: ../release/1.15.3-notes.rst
diff --git a/numpy/compat/py3k.py b/numpy/compat/py3k.py
index 8e06ead780bea7b84befd3f4c8265fc03c94d3f9..067292776e20b8f0d271fc62590307e0748a6de4 100644
--- a/numpy/compat/py3k.py
+++ b/numpy/compat/py3k.py
@@ -219,7 +219,7 @@ else:
         path representation is not str or bytes, TypeError is raised. If the
         provided path is not str, bytes, or os.PathLike, TypeError is raised.
         """
-        if isinstance(path, (str, bytes)):
+        if isinstance(path, (unicode, bytes)):
             return path
 
         # Work from the object's type to match method resolution of other magic
@@ -235,7 +235,7 @@ else:
             else:
                 raise TypeError("expected str, bytes or os.PathLike object, "
                                 "not " + path_type.__name__)
-        if isinstance(path_repr, (str, bytes)):
+        if isinstance(path_repr, (unicode, bytes)):
             return path_repr
         else:
             raise TypeError("expected {}.__fspath__() to return str or bytes, "
diff --git a/numpy/compat/tests/test_compat.py b/numpy/compat/tests/test_compat.py
index 1543aafaf540cf719176858c17a5cfd9a31a4c26..9bb316a4de7ba6c6f2c05657297f53f6be248c7d 100644
--- a/numpy/compat/tests/test_compat.py
+++ b/numpy/compat/tests/test_compat.py
@@ -2,7 +2,7 @@ from __future__ import division, absolute_import, print_function
 
 from os.path import join
 
-from numpy.compat import isfileobj
+from numpy.compat import isfileobj, os_fspath
 from numpy.testing import assert_
 from numpy.testing import tempdir
 
@@ -19,3 +19,8 @@ def test_isfileobj():
 
         with open(filename, 'rb') as f:
             assert_(isfileobj(f))
+
+
+def test_os_fspath_strings():
+    for string_path in (b'/a/b/c.d', u'/a/b/c.d'):
+        assert_(os_fspath(string_path) == string_path)
diff --git a/numpy/core/__init__.py b/numpy/core/__init__.py
index 80ce84f00aeee7ea6337b55b3bc84ebd1729ad68..6b76e63b7aa131d457e7b9107700448c52b46add 100644
--- a/numpy/core/__init__.py
+++ b/numpy/core/__init__.py
@@ -53,7 +53,19 @@ del env_added
 del os
 
 from . import umath
-from . import _internal  # for freeze programs
+
+# Check that multiarray,umath are pure python modules wrapping
+# _multiarray_umath and not either of the old c-extension modules
+if not (hasattr(multiarray, '_multiarray_umath') and
+        hasattr(umath, '_multiarray_umath')):
+    import sys
+    path = sys.modules['numpy'].__path__
+    msg = ("Something is wrong with the numpy installation. "
+        "While importing we detected an older version of "
+        "numpy in {}. One method of fixing this is to repeatedly uninstall "
+        "numpy until none is found, then reinstall this version.")
+    raise ImportError(msg.format(path))
+
 from . import numerictypes as nt
 multiarray.set_typeDict(nt.sctypeDict)
 from . import numeric
@@ -83,6 +95,11 @@ from .numeric import absolute as abs
 # do this after everything else, to minimize the chance of this misleadingly
 # appearing in an import-time traceback
 from . import _add_newdocs
+# add these for module-freeze analysis (like PyInstaller)
+from . import _dtype_ctypes
+from . import _internal
+from . import _dtype
+from . import _methods
 
 __all__ = ['char', 'rec', 'memmap']
 __all__ += numeric.__all__
diff --git a/numpy/core/_internal.py b/numpy/core/_internal.py
index 27a3deeda107ee93d3c233be05eb80427f9a3336..1d3bb558415c505a948f4753e61844a59f2d861e 100644
--- a/numpy/core/_internal.py
+++ b/numpy/core/_internal.py
@@ -830,6 +830,13 @@ def array_ufunc_errmsg_formatter(dummy, ufunc, method, *inputs, **kwargs):
             .format(ufunc, method, args_string, types_string))
 
 
+def array_function_errmsg_formatter(public_api, types):
+    """ Format the error message for when __array_ufunc__ gives up. """
+    func_name = '{}.{}'.format(public_api.__module__, public_api.__name__)
+    return ("no implementation found for '{}' on types that implement "
+            '__array_function__: {}'.format(func_name, list(types)))
+
+
 def _ufunc_doc_signature_formatter(ufunc):
     """
     Builds a signature string which resembles PEP 457
diff --git a/numpy/core/_methods.py b/numpy/core/_methods.py
index baeab6383a0b39a4c91dd0f76695aa5a1cb2e896..33f6d01a89c39dabe491a4ea9d9b12f3e1560be2 100644
--- a/numpy/core/_methods.py
+++ b/numpy/core/_methods.py
@@ -154,15 +154,3 @@ def _ptp(a, axis=None, out=None, keepdims=False):
         umr_minimum(a, axis, None, None, keepdims),
         out
     )
-
-_NDARRAY_ARRAY_FUNCTION = mu.ndarray.__array_function__
-
-def _array_function(self, func, types, args, kwargs):
-    # TODO: rewrite this in C
-    # Cannot handle items that have __array_function__ other than our own.
-    for t in types:
-        if not issubclass(t, mu.ndarray) and hasattr(t, '__array_function__'):
-            return NotImplemented
-
-    # The regular implementation can handle this, so we call it directly.
-    return func.__wrapped__(*args, **kwargs)
diff --git a/numpy/core/code_generators/genapi.py b/numpy/core/code_generators/genapi.py
index 1d2cd25c877a0e00345bffc35a21bdcaf8d1d929..4aca2373c6653339d9d75d783044beeeecebbe6c 100644
--- a/numpy/core/code_generators/genapi.py
+++ b/numpy/core/code_generators/genapi.py
@@ -19,6 +19,7 @@ __docformat__ = 'restructuredtext'
 
 # The files under src/ that are scanned for API functions
 API_FILES = [join('multiarray', 'alloc.c'),
+             join('multiarray', 'arrayfunction_override.c'),
              join('multiarray', 'array_assign_array.c'),
              join('multiarray', 'array_assign_scalar.c'),
              join('multiarray', 'arrayobject.c'),
diff --git a/numpy/core/code_generators/generate_umath.py b/numpy/core/code_generators/generate_umath.py
index f5ee02c4220aee888b32a83bf28fa558c077d1aa..0fac9b05eeffb5c0036be1260a226302e0f030f7 100644
--- a/numpy/core/code_generators/generate_umath.py
+++ b/numpy/core/code_generators/generate_umath.py
@@ -315,7 +315,7 @@ defdict = {
           TD(intfltcmplx),
           [TypeDescription('m', FullTypeDescr, 'mq', 'm'),
            TypeDescription('m', FullTypeDescr, 'md', 'm'),
-           #TypeDescription('m', FullTypeDescr, 'mm', 'd'),
+           TypeDescription('m', FullTypeDescr, 'mm', 'q'),
           ],
           TD(O, f='PyNumber_FloorDivide'),
           ),
@@ -802,8 +802,9 @@ defdict = {
 'divmod':
     Ufunc(2, 2, None,
           docstrings.get('numpy.core.umath.divmod'),
-          None,
+          'PyUFunc_DivmodTypeResolver',
           TD(intflt),
+          [TypeDescription('m', FullTypeDescr, 'mm', 'qm')],
           # TD(O, f='PyNumber_Divmod'),  # gh-9730
           ),
 'hypot':
diff --git a/numpy/core/multiarray.py b/numpy/core/multiarray.py
index df0ed2df4658a349a2bd378b578525215311516b..7908969220dacc01da99a5a8d394b71fba41cd69 100644
--- a/numpy/core/multiarray.py
+++ b/numpy/core/multiarray.py
@@ -40,6 +40,10 @@ __all__ = [
     'tracemalloc_domain', 'typeinfo', 'unpackbits', 'unravel_index', 'vdot',
     'where', 'zeros']
 
+# For backward compatibility, make sure pickle imports these functions from here
+_reconstruct.__module__ = 'numpy.core.multiarray'
+scalar.__module__ = 'numpy.core.multiarray'
+
 
 arange.__module__ = 'numpy'
 array.__module__ = 'numpy'
@@ -211,9 +215,11 @@ def concatenate(arrays, axis=None, out=None):
            fill_value=999999)
 
     """
-    for array in arrays:
-        yield array
-    yield out
+    if out is not None:
+        # optimize for the typical case where only arrays is provided
+        arrays = list(arrays)
+        arrays.append(out)
+    return arrays
 
 
 @array_function_from_c_func_and_dispatcher(_multiarray_umath.inner)
diff --git a/numpy/core/overrides.py b/numpy/core/overrides.py
index 0979858a1578f9c95a71f36e93a87f9fea3277d1..c55174ecda6638b05655a3852af26123062c74c9 100644
--- a/numpy/core/overrides.py
+++ b/numpy/core/overrides.py
@@ -1,73 +1,23 @@
-"""Preliminary implementation of NEP-18
-
-TODO: rewrite this in C for performance.
-"""
+"""Implementation of __array_function__ overrides from NEP-18."""
 import collections
 import functools
 import os
 
-from numpy.core._multiarray_umath import add_docstring, ndarray
+from numpy.core._multiarray_umath import (
+    add_docstring, implement_array_function, _get_implementing_args)
 from numpy.compat._inspect import getargspec
 
 
-_NDARRAY_ARRAY_FUNCTION = ndarray.__array_function__
-_NDARRAY_ONLY = [ndarray]
-
 ENABLE_ARRAY_FUNCTION = bool(
     int(os.environ.get('NUMPY_EXPERIMENTAL_ARRAY_FUNCTION', 0)))
 
 
-def get_overloaded_types_and_args(relevant_args):
-    """Returns a list of arguments on which to call __array_function__.
-
-    Parameters
-    ----------
-    relevant_args : iterable of array-like
-        Iterable of array-like arguments to check for __array_function__
-        methods.
-
-    Returns
-    -------
-    overloaded_types : collection of types
-        Types of arguments from relevant_args with __array_function__ methods.
-    overloaded_args : list
-        Arguments from relevant_args on which to call __array_function__
-        methods, in the order in which they should be called.
+add_docstring(
+    implement_array_function,
     """
-    # Runtime is O(num_arguments * num_unique_types)
-    overloaded_types = []
-    overloaded_args = []
-    for arg in relevant_args:
-        arg_type = type(arg)
-        # We only collect arguments if they have a unique type, which ensures
-        # reasonable performance even with a long list of possibly overloaded
-        # arguments.
-        if (arg_type not in overloaded_types and
-                hasattr(arg_type, '__array_function__')):
-
-            # Create lists explicitly for the first type (usually the only one
-            # done) to avoid setting up the iterator for overloaded_args.
-            if overloaded_types:
-                overloaded_types.append(arg_type)
-                # By default, insert argument at the end, but if it is
-                # subclass of another argument, insert it before that argument.
-                # This ensures "subclasses before superclasses".
-                index = len(overloaded_args)
-                for i, old_arg in enumerate(overloaded_args):
-                    if issubclass(arg_type, type(old_arg)):
-                        index = i
-                        break
-                overloaded_args.insert(index, arg)
-            else:
-                overloaded_types = [arg_type]
-                overloaded_args = [arg]
-
-    return overloaded_types, overloaded_args
-
-
-def array_function_implementation_or_override(
-        implementation, public_api, relevant_args, args, kwargs):
-    """Implement a function with checks for __array_function__ overrides.
+    Implement a function with checks for __array_function__ overrides.
+
+    All arguments are required, and can only be passed by position.
 
     Arguments
     ---------
@@ -82,41 +32,37 @@ def array_function_implementation_or_override(
         Iterable of arguments to check for __array_function__ methods.
     args : tuple
         Arbitrary positional arguments originally passed into ``public_api``.
-    kwargs : tuple
+    kwargs : dict
         Arbitrary keyword arguments originally passed into ``public_api``.
 
     Returns
     -------
-    Result from calling `implementation()` or an `__array_function__`
+    Result from calling ``implementation()`` or an ``__array_function__``
     method, as appropriate.
 
     Raises
     ------
     TypeError : if no implementation is found.
+    """)
+
+
+# exposed for testing purposes; used internally by implement_array_function
+add_docstring(
+    _get_implementing_args,
     """
-    # Check for __array_function__ methods.
-    types, overloaded_args = get_overloaded_types_and_args(relevant_args)
-    # Short-cut for common cases: no overload or only ndarray overload
-    # (directly or with subclasses that do not override __array_function__).
-    if (not overloaded_args or types == _NDARRAY_ONLY or
-            all(type(arg).__array_function__ is _NDARRAY_ARRAY_FUNCTION
-                for arg in overloaded_args)):
-        return implementation(*args, **kwargs)
-
-    # Call overrides
-    for overloaded_arg in overloaded_args:
-        # Use `public_api` instead of `implemenation` so __array_function__
-        # implementations can do equality/identity comparisons.
-        result = overloaded_arg.__array_function__(
-            public_api, types, args, kwargs)
-
-        if result is not NotImplemented:
-            return result
-
-    func_name = '{}.{}'.format(public_api.__module__, public_api.__name__)
-    raise TypeError("no implementation found for '{}' on types that implement "
-                    '__array_function__: {}'
-                    .format(func_name, list(map(type, overloaded_args))))
+    Collect arguments on which to call __array_function__.
+
+    Parameters
+    ----------
+    relevant_args : iterable of array-like
+        Iterable of possibly array-like arguments to check for
+        __array_function__ methods.
+
+    Returns
+    -------
+    Sequence of arguments with __array_function__ methods, in the order in
+    which they should be called.
+    """)
 
 
 ArgSpec = collections.namedtuple('ArgSpec', 'args varargs keywords defaults')
@@ -215,7 +161,7 @@ def array_function_dispatch(dispatcher, module=None, verify=True,
         @functools.wraps(implementation)
         def public_api(*args, **kwargs):
             relevant_args = dispatcher(*args, **kwargs)
-            return array_function_implementation_or_override(
+            return implement_array_function(
                 implementation, public_api, relevant_args, args, kwargs)
 
         if module is not None:
diff --git a/numpy/core/records.py b/numpy/core/records.py
index 86a43306a698197731556bc664ca37d3cf27f9aa..5898bb1631f6e792ec5e4640ae60a40ee4bea273 100644
--- a/numpy/core/records.py
+++ b/numpy/core/records.py
@@ -711,7 +711,7 @@ def fromstring(datastring, dtype=None, shape=None, offset=0, formats=None,
     a string"""
 
     if dtype is None and formats is None:
-        raise ValueError("Must have dtype= or formats=")
+        raise TypeError("fromstring() needs a 'dtype' or 'formats' argument")
 
     if dtype is not None:
         descr = sb.dtype(dtype)
@@ -758,6 +758,9 @@ def fromfile(fd, dtype=None, shape=None, offset=0, formats=None,
     >>> r.shape
     (10,)
     """
+    
+    if dtype is None and formats is None:
+        raise TypeError("fromfile() needs a 'dtype' or 'formats' argument")
 
     if (shape is None or shape == 0):
         shape = (-1,)
diff --git a/numpy/core/setup.py b/numpy/core/setup.py
index 467b590ac0afe4a47e9ae4a5d627ae089f518abb..00a9ffe69a2750f6224dd7bf9469668209ff1b8d 100644
--- a/numpy/core/setup.py
+++ b/numpy/core/setup.py
@@ -775,6 +775,7 @@ def configuration(parent_package='',top_path=None):
     multiarray_deps = [
             join('src', 'multiarray', 'arrayobject.h'),
             join('src', 'multiarray', 'arraytypes.h'),
+            join('src', 'multiarray', 'arrayfunction_override.h'),
             join('src', 'multiarray', 'buffer.h'),
             join('src', 'multiarray', 'calculation.h'),
             join('src', 'multiarray', 'common.h'),
@@ -827,6 +828,7 @@ def configuration(parent_package='',top_path=None):
             join('src', 'multiarray', 'arraytypes.c.src'),
             join('src', 'multiarray', 'array_assign_scalar.c'),
             join('src', 'multiarray', 'array_assign_array.c'),
+            join('src', 'multiarray', 'arrayfunction_override.c'),
             join('src', 'multiarray', 'buffer.c'),
             join('src', 'multiarray', 'calculation.c'),
             join('src', 'multiarray', 'compiled_base.c'),
@@ -960,6 +962,14 @@ def configuration(parent_package='',top_path=None):
     config.add_extension('_operand_flag_tests',
                     sources=[join('src', 'umath', '_operand_flag_tests.c.src')])
 
+    #######################################################################
+    #                        _multiarray_module_test module               #
+    #######################################################################
+
+    config.add_extension('_multiarray_module_test',
+                    sources=[join('src', 'multiarray',
+                                         '_multiarray_module_test.c')])
+
     config.add_data_dir('tests')
     config.add_data_dir('tests/data')
 
diff --git a/numpy/core/shape_base.py b/numpy/core/shape_base.py
index a529d2ad74c388b989c683e08f5e41d3ad5ff2e1..d20afd8be9dc7d2ac13e841a01642c495959b38b 100644
--- a/numpy/core/shape_base.py
+++ b/numpy/core/shape_base.py
@@ -342,10 +342,11 @@ def hstack(tup):
 
 def _stack_dispatcher(arrays, axis=None, out=None):
     arrays = _arrays_for_stack_dispatcher(arrays, stacklevel=6)
-    for a in arrays:
-        yield a
     if out is not None:
-        yield out
+        # optimize for the typical case where only arrays is provided
+        arrays = list(arrays)
+        arrays.append(out)
+    return arrays
 
 
 @array_function_dispatch(_stack_dispatcher)
diff --git a/numpy/core/src/common/get_attr_string.h b/numpy/core/src/common/get_attr_string.h
index bec87c5ed1c972122fc3c78115eb9d04784dfd55..d458d955004ae948725d3b78c7e5c2b8652e7eb8 100644
--- a/numpy/core/src/common/get_attr_string.h
+++ b/numpy/core/src/common/get_attr_string.h
@@ -103,7 +103,6 @@ PyArray_LookupSpecial(PyObject *obj, char *name)
     if (_is_basic_python_type(tp)) {
         return NULL;
     }
-
     return maybe_get_attr((PyObject *)tp, name);
 }
 
diff --git a/numpy/core/src/multiarray/_multiarray_module_test.c b/numpy/core/src/multiarray/_multiarray_module_test.c
new file mode 100644
index 0000000000000000000000000000000000000000..8dc017279e1da9db5f5800dcba2b98aee08a3fe3
--- /dev/null
+++ b/numpy/core/src/multiarray/_multiarray_module_test.c
@@ -0,0 +1,129 @@
+#include "Python.h"
+
+/*
+ * This is a dummy module. It will be used to ruin the import of multiarray
+ * during testing. It exports two entry points, one to make the build happy,
+ * and a multiarray one for the actual test. The content of the module is
+ * irrelevant to the test.
+ *
+ * The code is from
+ * https://docs.python.org/3/howto/cporting.html
+ * or
+ * https://github.com/python/cpython/blob/v3.7.0/Doc/howto/cporting.rst
+ */
+
+#if defined _WIN32 || defined __CYGWIN__ || defined __MINGW32__
+  #if defined __GNUC__ || defined __clang__
+    #define DLL_PUBLIC __attribute__ ((dllexport))
+  #else
+    #define DLL_PUBLIC __declspec(dllexport)
+  #endif
+#elif defined __GNUC__  || defined __clang__
+  #define DLL_PUBLIC __attribute__ ((visibility ("default")))
+#else
+    /* Enhancement: error now instead ? */
+    #define DLL_PUBLIC
+#endif
+
+struct module_state {
+    PyObject *error;
+};
+
+#if PY_MAJOR_VERSION >= 3
+#define GETSTATE(m) ((struct module_state*)PyModule_GetState(m))
+#else
+#define GETSTATE(m) (&_state)
+static struct module_state _state;
+#endif
+
+static PyObject *
+error_out(PyObject *m) {
+    struct module_state *st = GETSTATE(m);
+    PyErr_SetString(st->error, "something bad happened");
+    return NULL;
+}
+
+static PyMethodDef multiarray_methods[] = {
+    {"error_out", (PyCFunction)error_out, METH_NOARGS, NULL},
+    {NULL, NULL}
+};
+
+#if PY_MAJOR_VERSION >= 3
+
+static int multiarray_traverse(PyObject *m, visitproc visit, void *arg) {
+    Py_VISIT(GETSTATE(m)->error);
+    return 0;
+}
+
+static int multiarray_clear(PyObject *m) {
+    Py_CLEAR(GETSTATE(m)->error);
+    return 0;
+}
+
+
+static struct PyModuleDef moduledef = {
+        PyModuleDef_HEAD_INIT,
+        "multiarray",
+        NULL,
+        sizeof(struct module_state),
+        multiarray_methods,
+        NULL,
+        multiarray_traverse,
+        multiarray_clear,
+        NULL
+};
+
+#define INITERROR return NULL
+
+DLL_PUBLIC PyObject *
+PyInit_multiarray(void)
+
+#else
+#define INITERROR return
+
+void
+DLL_PUBLIC initmultiarray(void)
+#endif
+{
+#if PY_MAJOR_VERSION >= 3
+    PyObject *module = PyModule_Create(&moduledef);
+#else
+    PyObject *module = Py_InitModule("multiarray", multiarray_methods);
+#endif
+    struct module_state *st;
+    if (module == NULL)
+        INITERROR;
+    st = GETSTATE(module);
+
+    st->error = PyErr_NewException("multiarray.Error", NULL, NULL);
+    if (st->error == NULL) {
+        Py_DECREF(module);
+        INITERROR;
+    }
+
+#if PY_MAJOR_VERSION >= 3
+    return module;
+#endif
+}
+
+/*
+ * Define a dummy entry point to make MSVC happy
+ * Python's build system will export this function automatically
+ */
+#if PY_MAJOR_VERSION >= 3
+
+PyObject *
+PyInit__multiarray_module_test(void)
+{
+    return PyInit_multiarray();
+}
+
+#else
+
+void
+init_multiarray_module_test(void)
+{
+    initmultiarray();
+}
+
+#endif                                                    
diff --git a/numpy/core/src/multiarray/_multiarray_tests.c.src b/numpy/core/src/multiarray/_multiarray_tests.c.src
index 2a827557215a0960a2fe8a3c329857ffd609d22a..c26bd16ac992f803955a5f74769982c71368d54a 100644
--- a/numpy/core/src/multiarray/_multiarray_tests.c.src
+++ b/numpy/core/src/multiarray/_multiarray_tests.c.src
@@ -1871,11 +1871,14 @@ printf_float_g(PyObject *NPY_UNUSED(dummy), PyObject *args, PyObject *kwds)
 static PyObject *
 getset_numericops(PyObject* NPY_UNUSED(self), PyObject* NPY_UNUSED(args))
 {
-    PyObject * ops = PyArray_GetNumericOps();
+    PyObject *ret;
+    PyObject *ops = PyArray_GetNumericOps();
     if (ops == NULL) {
         return NULL;
     }
-    return PyLong_FromLong(PyArray_SetNumericOps(ops));
+    ret = PyLong_FromLong(PyArray_SetNumericOps(ops));
+    Py_DECREF(ops);
+    return ret;
 }
 
 static PyMethodDef Multiarray_TestsMethods[] = {
diff --git a/numpy/core/src/multiarray/arrayfunction_override.c b/numpy/core/src/multiarray/arrayfunction_override.c
new file mode 100644
index 0000000000000000000000000000000000000000..e62b32ab2e34fbc0c54447c00a2fe91b06fa9b67
--- /dev/null
+++ b/numpy/core/src/multiarray/arrayfunction_override.c
@@ -0,0 +1,376 @@
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define _MULTIARRAYMODULE
+
+#include "npy_pycompat.h"
+#include "get_attr_string.h"
+#include "npy_import.h"
+#include "multiarraymodule.h"
+
+
+/* Return the ndarray.__array_function__ method. */
+static PyObject *
+get_ndarray_array_function(void)
+{
+    PyObject* method = PyObject_GetAttrString((PyObject *)&PyArray_Type,
+                                              "__array_function__");
+    assert(method != NULL);
+    return method;
+}
+
+
+/*
+ * Get an object's __array_function__ method in the fastest way possible.
+ * Never raises an exception. Returns NULL if the method doesn't exist.
+ */
+static PyObject *
+get_array_function(PyObject *obj)
+{
+    static PyObject *ndarray_array_function = NULL;
+
+    if (ndarray_array_function == NULL) {
+        ndarray_array_function = get_ndarray_array_function();
+    }
+
+    /* Fast return for ndarray */
+    if (PyArray_CheckExact(obj)) {
+        Py_INCREF(ndarray_array_function);
+        return ndarray_array_function;
+    }
+
+    return PyArray_LookupSpecial(obj, "__array_function__");
+}
+
+
+/*
+ * Like list.insert(), but for C arrays of PyObject*. Skips error checking.
+ */
+static void
+pyobject_array_insert(PyObject **array, int length, int index, PyObject *item)
+{
+    int j;
+
+    for (j = length; j > index; j--) {
+        array[j] = array[j - 1];
+    }
+    array[index] = item;
+}
+
+
+/*
+ * Collects arguments with __array_function__ and their corresponding methods
+ * in the order in which they should be tried (i.e., skipping redundant types).
+ * `relevant_args` is expected to have been produced by PySequence_Fast.
+ * Returns the number of arguments, or -1 on failure. 
+ */
+static int
+get_implementing_args_and_methods(PyObject *relevant_args,
+                                  PyObject **implementing_args,
+                                  PyObject **methods)
+{
+    int num_implementing_args = 0;
+    Py_ssize_t i;
+    int j;
+
+    PyObject **items = PySequence_Fast_ITEMS(relevant_args);
+    Py_ssize_t length = PySequence_Fast_GET_SIZE(relevant_args);
+
+    for (i = 0; i < length; i++) {
+        int new_class = 1;
+        PyObject *argument = items[i];
+
+        /* Have we seen this type before? */
+        for (j = 0; j < num_implementing_args; j++) {
+            if (Py_TYPE(argument) == Py_TYPE(implementing_args[j])) {
+                new_class = 0;
+                break;
+            }
+        }
+        if (new_class) {
+            PyObject *method = get_array_function(argument);
+
+            if (method != NULL) {
+                int arg_index;
+
+                if (num_implementing_args >= NPY_MAXARGS) {
+                    PyErr_Format(
+                        PyExc_TypeError,
+                        "maximum number (%d) of distinct argument types " \
+                        "implementing __array_function__ exceeded",
+                        NPY_MAXARGS);
+                    Py_DECREF(method);
+                    goto fail;
+                }
+
+                /* "subclasses before superclasses, otherwise left to right" */
+                arg_index = num_implementing_args;
+                for (j = 0; j < num_implementing_args; j++) {
+                    PyObject *other_type;
+                    other_type = (PyObject *)Py_TYPE(implementing_args[j]);
+                    if (PyObject_IsInstance(argument, other_type)) {
+                        arg_index = j;
+                        break;
+                    }
+                }
+                Py_INCREF(argument);
+                pyobject_array_insert(implementing_args, num_implementing_args,
+                                      arg_index, argument);
+                pyobject_array_insert(methods, num_implementing_args,
+                                      arg_index, method);
+                ++num_implementing_args;
+            }
+        }
+    }
+    return num_implementing_args;
+
+fail:
+    for (j = 0; j < num_implementing_args; j++) {
+        Py_DECREF(implementing_args[j]);
+        Py_DECREF(methods[j]);
+    }
+    return -1;
+}
+
+
+/*
+ * Is this object ndarray.__array_function__?
+ */
+static int
+is_default_array_function(PyObject *obj)
+{
+    static PyObject *ndarray_array_function = NULL;
+
+    if (ndarray_array_function == NULL) {
+        ndarray_array_function = get_ndarray_array_function();
+    }
+    return obj == ndarray_array_function;
+}
+
+
+/*
+ * Core implementation of ndarray.__array_function__. This is exposed
+ * separately so we can avoid the overhead of a Python method call from
+ * within `implement_array_function`.
+ */
+NPY_NO_EXPORT PyObject *
+array_function_method_impl(PyObject *func, PyObject *types, PyObject *args,
+                           PyObject *kwargs)
+{
+    Py_ssize_t j;
+    PyObject *implementation, *result;
+
+    PyObject **items = PySequence_Fast_ITEMS(types);
+    Py_ssize_t length = PySequence_Fast_GET_SIZE(types);
+
+    for (j = 0; j < length; j++) {
+        int is_subclass = PyObject_IsSubclass(
+            items[j], (PyObject *)&PyArray_Type);
+        if (is_subclass == -1) {
+            return NULL;
+        }
+        if (!is_subclass) {
+            Py_INCREF(Py_NotImplemented);
+            return Py_NotImplemented;
+        }
+    }
+
+    implementation = PyObject_GetAttr(func, npy_ma_str_wrapped);
+    if (implementation == NULL) {
+        return NULL;
+    }
+    result = PyObject_Call(implementation, args, kwargs);
+    Py_DECREF(implementation);
+    return result;
+}
+
+
+/*
+ * Calls __array_function__ on the provided argument, with a fast-path for
+ * ndarray.
+ */
+static PyObject *
+call_array_function(PyObject* argument, PyObject* method,
+                    PyObject* public_api, PyObject* types,
+                    PyObject* args, PyObject* kwargs)
+{
+    if (is_default_array_function(method)) {
+        return array_function_method_impl(public_api, types, args, kwargs);
+    }
+    else {
+        return PyObject_CallFunctionObjArgs(
+            method, argument, public_api, types, args, kwargs, NULL);
+    }
+}
+
+
+/*
+ * Implements the __array_function__ protocol for a function, as described in
+ * in NEP-18. See numpy.core.overrides for a full docstring.
+ */
+NPY_NO_EXPORT PyObject *
+array_implement_array_function(
+    PyObject *NPY_UNUSED(dummy), PyObject *positional_args)
+{
+    PyObject *implementation, *public_api, *relevant_args, *args, *kwargs;
+
+    PyObject *types = NULL;
+    PyObject *implementing_args[NPY_MAXARGS];
+    PyObject *array_function_methods[NPY_MAXARGS];
+
+    int j, any_overrides;
+    int num_implementing_args = 0;
+    PyObject *result = NULL;
+
+    static PyObject *errmsg_formatter = NULL;
+
+    if (!PyArg_UnpackTuple(
+            positional_args, "implement_array_function", 5, 5,
+            &implementation, &public_api, &relevant_args, &args, &kwargs)) {
+        return NULL;
+    }
+
+    relevant_args = PySequence_Fast(
+        relevant_args,
+        "dispatcher for __array_function__ did not return an iterable");
+    if (relevant_args == NULL) {
+        return NULL;
+    }
+
+    /* Collect __array_function__ implementations */
+    num_implementing_args = get_implementing_args_and_methods(
+        relevant_args, implementing_args, array_function_methods);
+    if (num_implementing_args == -1) {
+        goto cleanup;
+    }
+
+    /*
+     * Handle the typical case of no overrides. This is merely an optimization
+     * if some arguments are ndarray objects, but is also necessary if no
+     * arguments implement __array_function__ at all (e.g., if they are all
+     * built-in types).
+     */
+    any_overrides = 0;
+    for (j = 0; j < num_implementing_args; j++) {
+        if (!is_default_array_function(array_function_methods[j])) {
+            any_overrides = 1;
+            break;
+        }
+    }
+    if (!any_overrides) {
+        result = PyObject_Call(implementation, args, kwargs);
+        goto cleanup;
+    }
+
+    /*
+     * Create a Python object for types.
+     * We use a tuple, because it's the fastest Python collection to create
+     * and has the bonus of being immutable.
+     */
+    types = PyTuple_New(num_implementing_args);
+    if (types == NULL) {
+        goto cleanup;
+    }
+    for (j = 0; j < num_implementing_args; j++) {
+        PyObject *arg_type = (PyObject *)Py_TYPE(implementing_args[j]);
+        Py_INCREF(arg_type);
+        PyTuple_SET_ITEM(types, j, arg_type);
+    }
+
+    /* Call __array_function__ methods */
+    for (j = 0; j < num_implementing_args; j++) {
+        PyObject *argument = implementing_args[j];
+        PyObject *method = array_function_methods[j];
+
+        /*
+         * We use `public_api` instead of `implementation` here so
+         * __array_function__ implementations can do equality/identity
+         * comparisons.
+         */
+        result = call_array_function(
+            argument, method, public_api, types, args, kwargs);
+
+        if (result == Py_NotImplemented) {
+            /* Try the next one */
+            Py_DECREF(result);
+            result = NULL;
+        }
+        else {
+            /* Either a good result, or an exception was raised. */
+            goto cleanup;
+        }
+    }
+
+    /* No acceptable override found, raise TypeError. */
+    npy_cache_import("numpy.core._internal",
+                     "array_function_errmsg_formatter",
+                     &errmsg_formatter);
+    if (errmsg_formatter != NULL) {
+        PyObject *errmsg = PyObject_CallFunctionObjArgs(
+            errmsg_formatter, public_api, types, NULL);
+        if (errmsg != NULL) {
+            PyErr_SetObject(PyExc_TypeError, errmsg);
+            Py_DECREF(errmsg);
+        }
+    }
+
+cleanup:
+    for (j = 0; j < num_implementing_args; j++) {
+        Py_DECREF(implementing_args[j]);
+        Py_DECREF(array_function_methods[j]);
+    }
+    Py_XDECREF(types);
+    Py_DECREF(relevant_args);
+    return result;
+}
+
+
+/*
+ * Python wrapper for get_implementing_args_and_methods, for testing purposes.
+ */
+NPY_NO_EXPORT PyObject *
+array__get_implementing_args(
+    PyObject *NPY_UNUSED(dummy), PyObject *positional_args)
+{
+    PyObject *relevant_args;
+    int j;
+    int num_implementing_args = 0;
+    PyObject *implementing_args[NPY_MAXARGS];
+    PyObject *array_function_methods[NPY_MAXARGS];
+    PyObject *result = NULL;
+
+    if (!PyArg_ParseTuple(positional_args, "O:array__get_implementing_args",
+                          &relevant_args)) {
+        return NULL;
+    }
+
+    relevant_args = PySequence_Fast(
+        relevant_args,
+        "dispatcher for __array_function__ did not return an iterable");
+    if (relevant_args == NULL) {
+        return NULL;
+    }
+
+    num_implementing_args = get_implementing_args_and_methods(
+        relevant_args, implementing_args, array_function_methods);
+    if (num_implementing_args == -1) {
+        goto cleanup;
+    }
+
+    /* create a Python object for implementing_args */
+    result = PyList_New(num_implementing_args);
+    if (result == NULL) {
+        goto cleanup;
+    }
+    for (j = 0; j < num_implementing_args; j++) {
+        PyObject *argument = implementing_args[j];
+        Py_INCREF(argument);
+        PyList_SET_ITEM(result, j, argument);
+    }
+
+cleanup:
+    for (j = 0; j < num_implementing_args; j++) {
+        Py_DECREF(implementing_args[j]);
+        Py_DECREF(array_function_methods[j]);
+    }
+    Py_DECREF(relevant_args);
+    return result;
+}
diff --git a/numpy/core/src/multiarray/arrayfunction_override.h b/numpy/core/src/multiarray/arrayfunction_override.h
new file mode 100644
index 0000000000000000000000000000000000000000..0d224e2b690b1ab2dd97c4da6b0727f2581fe0d8
--- /dev/null
+++ b/numpy/core/src/multiarray/arrayfunction_override.h
@@ -0,0 +1,16 @@
+#ifndef _NPY_PRIVATE__ARRAYFUNCTION_OVERRIDE_H
+#define _NPY_PRIVATE__ARRAYFUNCTION_OVERRIDE_H
+
+NPY_NO_EXPORT PyObject *
+array_implement_array_function(
+    PyObject *NPY_UNUSED(dummy), PyObject *positional_args);
+
+NPY_NO_EXPORT PyObject *
+array__get_implementing_args(
+    PyObject *NPY_UNUSED(dummy), PyObject *positional_args);
+
+NPY_NO_EXPORT PyObject *
+array_function_method_impl(PyObject *func, PyObject *types, PyObject *args,
+                           PyObject *kwargs);
+
+#endif
diff --git a/numpy/core/src/multiarray/arraytypes.c.src b/numpy/core/src/multiarray/arraytypes.c.src
index 823ee7115cc63812bba3389d1a8cc796dc87a8c4..ca5f5a47be5c694dc7e34c67138eb51b3df257fb 100644
--- a/numpy/core/src/multiarray/arraytypes.c.src
+++ b/numpy/core/src/multiarray/arraytypes.c.src
@@ -2205,15 +2205,19 @@ static void
 VOID_copyswapn (char *dst, npy_intp dstride, char *src, npy_intp sstride,
                 npy_intp n, int swap, PyArrayObject *arr)
 {
+    PyArray_Descr *descr;
+
     if (arr == NULL) {
         return;
     }
+
+    descr = PyArray_DESCR(arr);
+
     if (PyArray_HASFIELDS(arr)) {
         PyObject *key, *value;
-        PyArray_Descr *descr;
+
         Py_ssize_t pos = 0;
 
-        descr = PyArray_DESCR(arr);
         while (PyDict_Next(descr->fields, &pos, &key, &value)) {
             npy_intp offset;
             PyArray_Descr * new;
@@ -2236,14 +2240,28 @@ VOID_copyswapn (char *dst, npy_intp dstride, char *src, npy_intp sstride,
         ((PyArrayObject_fields *)arr)->descr = descr;
         return;
     }
-    if (swap && PyArray_DESCR(arr)->subarray != NULL) {
-        PyArray_Descr *descr, *new;
+    if (PyDataType_HASSUBARRAY(descr)) {
+        PyArray_Descr *new;
         npy_intp num;
         npy_intp i;
         int subitemsize;
         char *dstptr, *srcptr;
+        /*
+         * In certain cases subarray copy can be optimized. This is when
+         * swapping is unecessary and the subarrays data type can certainly
+         * be simply copied (no object, fields, subarray, and not a user dtype).
+         */
+        npy_bool can_optimize_subarray = (!swap &&
+                !PyDataType_HASFIELDS(descr->subarray->base) &&
+                !PyDataType_HASSUBARRAY(descr->subarray->base) &&
+                !PyDataType_REFCHK(descr->subarray->base) &&
+                (descr->subarray->base->type_num < NPY_NTYPES));
+
+        if (can_optimize_subarray) {
+            _basic_copyn(dst, dstride, src, sstride, n, descr->elsize);
+            return;
+        }
 
-        descr = PyArray_DESCR(arr);
         new = descr->subarray->base;
         /*
          * TODO: temporarily modifying the array like this
@@ -2253,6 +2271,10 @@ VOID_copyswapn (char *dst, npy_intp dstride, char *src, npy_intp sstride,
         dstptr = dst;
         srcptr = src;
         subitemsize = new->elsize;
+        if (subitemsize == 0) {
+            /* There cannot be any elements, so return */
+            return;
+        }
         num = descr->elsize / subitemsize;
         for (i = 0; i < n; i++) {
             new->f->copyswapn(dstptr, subitemsize, srcptr,
@@ -2265,22 +2287,26 @@ VOID_copyswapn (char *dst, npy_intp dstride, char *src, npy_intp sstride,
         ((PyArrayObject_fields *)arr)->descr = descr;
         return;
     }
-    _basic_copyn(dst, dstride, src, sstride, n, PyArray_DESCR(arr)->elsize);
+    /* Must be a naive Void type (e.g. a "V8") so simple copy is sufficient. */
+    _basic_copyn(dst, dstride, src, sstride, n, descr->elsize);
     return;
 }
 
 static void
 VOID_copyswap (char *dst, char *src, int swap, PyArrayObject *arr)
 {
+    PyArray_Descr *descr;
+
     if (arr == NULL) {
         return;
     }
+
+    descr = PyArray_DESCR(arr);
+
     if (PyArray_HASFIELDS(arr)) {
         PyObject *key, *value;
-        PyArray_Descr *descr;
         Py_ssize_t pos = 0;
 
-        descr = PyArray_DESCR(arr);
         while (PyDict_Next(descr->fields, &pos, &key, &value)) {
             npy_intp offset;
             PyArray_Descr * new;
@@ -2303,28 +2329,45 @@ VOID_copyswap (char *dst, char *src, int swap, PyArrayObject *arr)
         ((PyArrayObject_fields *)arr)->descr = descr;
         return;
     }
-    if (swap && PyArray_DESCR(arr)->subarray != NULL) {
-        PyArray_Descr *descr, *new;
+    if (PyDataType_HASSUBARRAY(descr)) {
+        PyArray_Descr *new;
         npy_intp num;
-        int itemsize;
+        int subitemsize;
+        /*
+         * In certain cases subarray copy can be optimized. This is when
+         * swapping is unecessary and the subarrays data type can certainly
+         * be simply copied (no object, fields, subarray, and not a user dtype).
+         */
+        npy_bool can_optimize_subarray = (!swap &&
+                !PyDataType_HASFIELDS(descr->subarray->base) &&
+                !PyDataType_HASSUBARRAY(descr->subarray->base) &&
+                !PyDataType_REFCHK(descr->subarray->base) &&
+                (descr->subarray->base->type_num < NPY_NTYPES));
+
+        if (can_optimize_subarray) {
+            _basic_copy(dst, src, descr->elsize);
+            return;
+        }
 
-        descr = PyArray_DESCR(arr);
         new = descr->subarray->base;
         /*
          * TODO: temporarily modifying the array like this
          *       is bad coding style, should be changed.
          */
         ((PyArrayObject_fields *)arr)->descr = new;
-        itemsize = new->elsize;
-        num = descr->elsize / itemsize;
-        new->f->copyswapn(dst, itemsize, src,
-                itemsize, num, swap, arr);
+        subitemsize = new->elsize;
+        if (subitemsize == 0) {
+            /* There cannot be any elements, so return */
+            return;
+        }
+        num = descr->elsize / subitemsize;
+        new->f->copyswapn(dst, subitemsize, src,
+                subitemsize, num, swap, arr);
         ((PyArrayObject_fields *)arr)->descr = descr;
         return;
     }
-
-    /* copy first if needed */
-    _basic_copy(dst, src, PyArray_DESCR(arr)->elsize);
+    /* Must be a naive Void type (e.g. a "V8") so simple copy is sufficient. */
+    _basic_copy(dst, src, descr->elsize);
     return;
 }
 
diff --git a/numpy/core/src/multiarray/buffer.c b/numpy/core/src/multiarray/buffer.c
index 2f66d7f2f391a8c5c170caed85fce575302b623e..d8ad802664316d70d8c635c864e9b2970126f359 100644
--- a/numpy/core/src/multiarray/buffer.c
+++ b/numpy/core/src/multiarray/buffer.c
@@ -509,6 +509,10 @@ _buffer_info_new(PyObject *obj)
     PyArray_Descr *descr = NULL;
     int err = 0;
 
+    /*
+     * Note that the buffer info is cached as pyints making them appear like
+     * unreachable lost memory to valgrind.
+     */
     info = malloc(sizeof(_buffer_info_t));
     if (info == NULL) {
         PyErr_NoMemory();
@@ -579,9 +583,11 @@ _buffer_info_new(PyObject *obj)
     err = _buffer_format_string(descr, &fmt, obj, NULL, NULL);
     Py_DECREF(descr);
     if (err != 0) {
+        free(info->shape);
         goto fail;
     }
     if (_append_char(&fmt, '\0') < 0) {
+        free(info->shape);
         goto fail;
     }
     info->format = fmt.s;
diff --git a/numpy/core/src/multiarray/common.c b/numpy/core/src/multiarray/common.c
index 2e51cee7e2f639f6f37f56a6f24a854ecbd82962..addb67732f318b70485401ae49f20d36874fcac0 100644
--- a/numpy/core/src/multiarray/common.c
+++ b/numpy/core/src/multiarray/common.c
@@ -164,7 +164,7 @@ PyArray_DTypeFromObjectHelper(PyObject *obj, int maxdims,
 
             if (string_type == NPY_STRING) {
                 if ((temp = PyObject_Str(obj)) == NULL) {
-                    return -1;
+                    goto fail;
                 }
 #if defined(NPY_PY3K)
     #if PY_VERSION_HEX >= 0x03030000
@@ -182,7 +182,7 @@ PyArray_DTypeFromObjectHelper(PyObject *obj, int maxdims,
 #else
                 if ((temp = PyObject_Unicode(obj)) == NULL) {
 #endif
-                    return -1;
+                    goto fail;
                 }
                 itemsize = PyUnicode_GET_DATA_SIZE(temp);
 #ifndef Py_UNICODE_WIDE
@@ -216,7 +216,7 @@ PyArray_DTypeFromObjectHelper(PyObject *obj, int maxdims,
 
             if (string_type == NPY_STRING) {
                 if ((temp = PyObject_Str(obj)) == NULL) {
-                    return -1;
+                    goto fail;
                 }
 #if defined(NPY_PY3K)
     #if PY_VERSION_HEX >= 0x03030000
@@ -234,7 +234,7 @@ PyArray_DTypeFromObjectHelper(PyObject *obj, int maxdims,
 #else
                 if ((temp = PyObject_Unicode(obj)) == NULL) {
 #endif
-                    return -1;
+                    goto fail;
                 }
                 itemsize = PyUnicode_GET_DATA_SIZE(temp);
 #ifndef Py_UNICODE_WIDE
@@ -511,7 +511,7 @@ promote_types:
         PyArray_Descr *res_dtype = PyArray_PromoteTypes(dtype, *out_dtype);
         Py_DECREF(dtype);
         if (res_dtype == NULL) {
-            return -1;
+            goto fail;
         }
         if (!string_type &&
                 res_dtype->type_num == NPY_UNICODE &&
diff --git a/numpy/core/src/multiarray/compiled_base.c b/numpy/core/src/multiarray/compiled_base.c
index 10e3478e2df3e44383ef3de02886f2d9f44b0ead..625028bfb04bb7c5f4588f7d220977c29748ca00 100644
--- a/numpy/core/src/multiarray/compiled_base.c
+++ b/numpy/core/src/multiarray/compiled_base.c
@@ -328,6 +328,7 @@ arr_insert(PyObject *NPY_UNUSED(self), PyObject *args, PyObject *kwdict)
         } else {
             Py_XDECREF(values);
             Py_XDECREF(mask);
+            PyArray_ResolveWritebackIfCopy(array);
             Py_XDECREF(array);
             Py_RETURN_NONE;
         }
@@ -358,6 +359,7 @@ arr_insert(PyObject *NPY_UNUSED(self), PyObject *args, PyObject *kwdict)
 
  fail:
     Py_XDECREF(mask);
+    PyArray_ResolveWritebackIfCopy(array);
     Py_XDECREF(array);
     Py_XDECREF(values);
     return NULL;
@@ -1575,6 +1577,7 @@ pack_bits(PyObject *input, int axis)
     if (!PyArray_ISBOOL(inp) && !PyArray_ISINTEGER(inp)) {
         PyErr_SetString(PyExc_TypeError,
                 "Expected an input array of integer or boolean data type");
+        Py_DECREF(inp);
         goto fail;
     }
 
@@ -1682,6 +1685,7 @@ unpack_bits(PyObject *input, int axis)
     if (PyArray_TYPE(inp) != NPY_UBYTE) {
         PyErr_SetString(PyExc_TypeError,
                 "Expected an input array of unsigned byte data type");
+        Py_DECREF(inp);
         goto fail;
     }
 
diff --git a/numpy/core/src/multiarray/ctors.c b/numpy/core/src/multiarray/ctors.c
index a176219460147e0a744ff8857252c0944301ec10..b9059ba4dba7655aca81e9e38a71b76a43f2a936 100644
--- a/numpy/core/src/multiarray/ctors.c
+++ b/numpy/core/src/multiarray/ctors.c
@@ -1410,6 +1410,7 @@ _array_from_buffer_3118(PyObject *memoryview)
          * dimensions, so the array is now 0d.
          */
         nd = 0;
+        Py_DECREF(descr);
         descr = (PyArray_Descr *)PyObject_CallFunctionObjArgs(
                 (PyObject *)&PyArrayDescr_Type, Py_TYPE(view->obj), NULL);
         if (descr == NULL) {
@@ -2128,12 +2129,15 @@ PyArray_FromArray(PyArrayObject *arr, PyArray_Descr *newtype, int flags)
              */
 
             /* 2017-Nov-10 1.14 */
-            if (DEPRECATE("NPY_ARRAY_UPDATEIFCOPY, NPY_ARRAY_INOUT_ARRAY, and "
-                "NPY_ARRAY_INOUT_FARRAY are deprecated, use NPY_WRITEBACKIFCOPY, "
-                "NPY_ARRAY_INOUT_ARRAY2, or NPY_ARRAY_INOUT_FARRAY2 respectively "
-                "instead, and call PyArray_ResolveWritebackIfCopy before the "
-                "array is deallocated, i.e. before the last call to Py_DECREF.") < 0)
+            if (DEPRECATE(
+                    "NPY_ARRAY_UPDATEIFCOPY, NPY_ARRAY_INOUT_ARRAY, and "
+                    "NPY_ARRAY_INOUT_FARRAY are deprecated, use NPY_WRITEBACKIFCOPY, "
+                    "NPY_ARRAY_INOUT_ARRAY2, or NPY_ARRAY_INOUT_FARRAY2 respectively "
+                    "instead, and call PyArray_ResolveWritebackIfCopy before the "
+                    "array is deallocated, i.e. before the last call to Py_DECREF.") < 0) {
+                Py_DECREF(ret);
                 return NULL;
+            }
             Py_INCREF(arr);
             if (PyArray_SetWritebackIfCopyBase(ret, arr) < 0) {
                 Py_DECREF(ret);
@@ -2160,14 +2164,12 @@ PyArray_FromArray(PyArrayObject *arr, PyArray_Descr *newtype, int flags)
 
         Py_DECREF(newtype);
         if (needview) {
-            PyArray_Descr *dtype = PyArray_DESCR(arr);
             PyTypeObject *subtype = NULL;
 
             if (flags & NPY_ARRAY_ENSUREARRAY) {
                 subtype = &PyArray_Type;
             }
 
-            Py_INCREF(dtype);
             ret = (PyArrayObject *)PyArray_View(arr, NULL, subtype);
             if (ret == NULL) {
                 return NULL;
@@ -2495,6 +2497,11 @@ PyArray_FromInterface(PyObject *origin)
             &PyArray_Type, dtype,
             n, dims, NULL, data,
             dataflags, NULL, base);
+    /*
+     * Ref to dtype was stolen by PyArray_NewFromDescrAndBase
+     * Prevent DECREFing dtype in fail codepath by setting to NULL
+     */
+    dtype = NULL;
     if (ret == NULL) {
         goto fail;
     }
diff --git a/numpy/core/src/multiarray/datetime.c b/numpy/core/src/multiarray/datetime.c
index a8550d95857066df7a557db9eaf3635eb80e146d..54d19d993b11ad111e5db95051c2f7ead4efdaef 100644
--- a/numpy/core/src/multiarray/datetime.c
+++ b/numpy/core/src/multiarray/datetime.c
@@ -3822,18 +3822,26 @@ recursive_find_object_timedelta64_type(PyObject *obj,
                  * single object using [()], but not by using
                  * __getitem__(integer) approaches
                  */
-                PyObject *item, *meth, *args;
+                PyObject *item, *args;
 
-                meth = PyObject_GetAttrString(obj, "__getitem__");
-                args = Py_BuildValue("(())");
-                item = PyObject_CallObject(meth, args);
+                args = PyTuple_New(0);
+                if (args == NULL) {
+                    return 0;
+                }
+                item = PyObject_GetItem(obj, args);
+                Py_DECREF(args);
+                if (item == NULL) {
+                    return 0;
+                }
                 /*
                  * NOTE: may need other type checks here in the future
                  * for expanded 0 D datetime array conversions?
                  */
                 if (PyDelta_Check(item)) {
+                    Py_DECREF(item);
                     return delta_checker(meta);
                 }
+                Py_DECREF(item);
             }
         }
     }
diff --git a/numpy/core/src/multiarray/descriptor.c b/numpy/core/src/multiarray/descriptor.c
index 3038e4dead526cc37982640b7d4d6c26202b43b3..0471a2a3e3ad784bcacb4e8bfe24fcf5a895a87e 100644
--- a/numpy/core/src/multiarray/descriptor.c
+++ b/numpy/core/src/multiarray/descriptor.c
@@ -515,6 +515,7 @@ _convert_from_array_descr(PyObject *obj, int align)
 #if defined(NPY_PY3K)
             Py_DECREF(name);
 #endif
+            Py_DECREF(conv);
             goto fail;
         }
         dtypeflags |= (conv->flags & NPY_FROM_FIELDS);
@@ -837,9 +838,11 @@ _use_inherit(PyArray_Descr *type, PyObject *newobj, int *errflag)
     else if (new->elsize != conv->elsize) {
         PyErr_SetString(PyExc_ValueError,
                 "mismatch in size of old and new data-descriptor");
+        Py_DECREF(new);
         goto fail;
     }
     else if (invalid_union_object_dtype(new, conv)) {
+        Py_DECREF(new);
         goto fail;
     }
 
@@ -1728,6 +1731,7 @@ PyArray_DescrNew(PyArray_Descr *base)
         newdescr->c_metadata = NPY_AUXDATA_CLONE(base->c_metadata);
         if (newdescr->c_metadata == NULL) {
             PyErr_NoMemory();
+            /* TODO: This seems wrong, as the old fields get decref'd? */
             Py_DECREF(newdescr);
             return NULL;
         }
@@ -3336,12 +3340,15 @@ static PyObject *
 _subscript_by_index(PyArray_Descr *self, Py_ssize_t i)
 {
     PyObject *name = PySequence_GetItem(self->names, i);
+    PyObject *ret;
     if (name == NULL) {
         PyErr_Format(PyExc_IndexError,
                      "Field index %zd out of range.", i);
         return NULL;
     }
-    return _subscript_by_name(self, name);
+    ret = _subscript_by_name(self, name);
+    Py_DECREF(name);
+    return ret;
 }
 
 static PyObject *
diff --git a/numpy/core/src/multiarray/dtype_transfer.c b/numpy/core/src/multiarray/dtype_transfer.c
index 63b1ead25cb37142cdbb8f3339ca090c504d6574..6347d35eb7f10ae9c8dff3c715ccfd1048ae0c19 100644
--- a/numpy/core/src/multiarray/dtype_transfer.c
+++ b/numpy/core/src/multiarray/dtype_transfer.c
@@ -1572,12 +1572,30 @@ get_cast_transfer_function(int aligned,
                                 src_dtype,
                                 &tobuffer, &todata);
 
-
-        /* Get the copy/swap operation to dst */
-        PyArray_GetDTypeCopySwapFn(aligned,
-                                dst_itemsize, dst_stride,
-                                dst_dtype,
-                                &frombuffer, &fromdata);
+        if (!PyDataType_REFCHK(dst_dtype)) {
+            /* Copying from buffer is a simple copy/swap operation */
+            PyArray_GetDTypeCopySwapFn(aligned,
+                                    dst_itemsize, dst_stride,
+                                    dst_dtype,
+                                    &frombuffer, &fromdata);
+        }
+        else {
+            /*
+             * Since the buffer is initialized to NULL, need to move the
+             * references in order to DECREF the existing data.
+             */
+             /* Object types cannot be byte swapped */
+            assert(PyDataType_ISNOTSWAPPED(dst_dtype));
+            /* The loop already needs the python api if this is reached */
+            assert(*out_needs_api);
+
+            if (PyArray_GetDTypeTransferFunction(
+                    aligned, dst_itemsize, dst_stride,
+                    dst_dtype, dst_dtype, 1,
+                    &frombuffer, &fromdata, out_needs_api) != NPY_SUCCEED) {
+                return NPY_FAIL;
+            }
+        }
 
         if (frombuffer == NULL || tobuffer == NULL) {
             NPY_AUXDATA_FREE(castdata);
@@ -2001,6 +2019,7 @@ typedef struct {
     _subarray_broadcast_offsetrun offsetruns;
 } _subarray_broadcast_data;
 
+
 /* transfer data free function */
 static void _subarray_broadcast_data_free(NpyAuxData *data)
 {
diff --git a/numpy/core/src/multiarray/methods.c b/numpy/core/src/multiarray/methods.c
index 7c814e6e6293a27313c4dbafedfeafeb8018cf2d..2fcc2ec22665161f8d6beca47f890a2bb530b4aa 100644
--- a/numpy/core/src/multiarray/methods.c
+++ b/numpy/core/src/multiarray/methods.c
@@ -8,6 +8,7 @@
 #include "numpy/arrayobject.h"
 #include "numpy/arrayscalars.h"
 
+#include "arrayfunction_override.h"
 #include "npy_config.h"
 #include "npy_pycompat.h"
 #include "npy_import.h"
@@ -1088,13 +1089,29 @@ cleanup:
     return result;
 }
 
-
 static PyObject *
-array_function(PyArrayObject *self, PyObject *args, PyObject *kwds)
+array_function(PyArrayObject *self, PyObject *c_args, PyObject *c_kwds)
 {
-    NPY_FORWARD_NDARRAY_METHOD("_array_function");
-}
+    PyObject *func, *types, *args, *kwargs, *result;
+    static char *kwlist[] = {"func", "types", "args", "kwargs", NULL};
+
+    if (!PyArg_ParseTupleAndKeywords(
+            c_args, c_kwds, "OOOO:__array_function__", kwlist,
+            &func, &types, &args, &kwargs)) {
+        return NULL;
+    }
 
+    types = PySequence_Fast(
+        types,
+        "types argument to ndarray.__array_function__ must be iterable");
+    if (types == NULL) {
+        return NULL;
+    }
+
+    result = array_function_method_impl(func, types, args, kwargs);
+    Py_DECREF(types);
+    return result;
+}
 
 static PyObject *
 array_copy(PyArrayObject *self, PyObject *args, PyObject *kwds)
@@ -1364,6 +1381,7 @@ array_argsort(PyArrayObject *self, PyObject *args, PyObject *kwds)
             return NULL;
         }
         newd = PyArray_DescrNew(saved);
+        Py_DECREF(newd->names);
         newd->names = new_name;
         ((PyArrayObject_fields *)self)->descr = newd;
     }
@@ -1418,6 +1436,7 @@ array_argpartition(PyArrayObject *self, PyObject *args, PyObject *kwds)
             return NULL;
         }
         newd = PyArray_DescrNew(saved);
+        Py_DECREF(newd->names);
         newd->names = new_name;
         ((PyArrayObject_fields *)self)->descr = newd;
     }
@@ -1521,7 +1540,6 @@ array_deepcopy(PyArrayObject *self, PyObject *args)
         copy = PyImport_ImportModule("copy");
         if (copy == NULL) {
             Py_DECREF(copied_array);
-            Py_DECREF(copy);
             return NULL;
         }
         deepcopy = PyObject_GetAttrString(copy, "deepcopy");
@@ -1704,129 +1722,150 @@ array_reduce(PyArrayObject *self, PyObject *NPY_UNUSED(args))
 }
 
 static PyObject *
-array_reduce_ex(PyArrayObject *self, PyObject *args)
+array_reduce_ex_regular(PyArrayObject *self, int protocol)
 {
-    int protocol;
-    PyObject *ret = NULL, *numeric_mod = NULL, *from_buffer_func = NULL;
-    PyObject *buffer_tuple = NULL, *pickle_module = NULL, *pickle_class = NULL;
-    PyObject *class_args = NULL, *class_args_tuple = NULL, *unused = NULL;
     PyObject *subclass_array_reduce = NULL;
+    PyObject *ret;
+
+    /* We do not call array_reduce directly but instead lookup and call
+     * the __reduce__ method to make sure that it's possible to customize
+     * pickling in sub-classes. */
+    subclass_array_reduce = PyObject_GetAttrString((PyObject *)self,
+                                                   "__reduce__");
+    if (subclass_array_reduce == NULL) {
+        return NULL;
+    }
+    ret = PyObject_CallObject(subclass_array_reduce, NULL);
+    Py_DECREF(subclass_array_reduce);
+    return ret;
+}
+
+static PyObject *
+array_reduce_ex_picklebuffer(PyArrayObject *self, int protocol)
+{
+    PyObject *numeric_mod = NULL, *from_buffer_func = NULL;
+    PyObject *pickle_module = NULL, *picklebuf_class = NULL;
+    PyObject *picklebuf_args = NULL;
     PyObject *buffer = NULL, *transposed_array = NULL;
     PyArray_Descr *descr = NULL;
     char order;
 
-    if (PyArg_ParseTuple(args, "i", &protocol)){
-        descr = PyArray_DESCR(self);
-        if ((protocol < 5) ||
-            (!PyArray_IS_C_CONTIGUOUS((PyArrayObject*)self) &&
-             !PyArray_IS_F_CONTIGUOUS((PyArrayObject*)self)) ||
-            PyDataType_FLAGCHK(descr, NPY_ITEM_HASOBJECT) ||
-            (PyType_IsSubtype(((PyObject*)self)->ob_type, &PyArray_Type) &&
-             ((PyObject*)self)->ob_type != &PyArray_Type) ||
-            PyDataType_ISUNSIZED(descr)) {
-            /* The PickleBuffer class from version 5 of the pickle protocol
-             * can only be used for arrays backed by a contiguous data buffer.
-             * For all other cases we fallback to the generic array_reduce
-             * method that involves using a temporary bytes allocation. However
-             * we do not call array_reduce directly but instead lookup and call
-             * the __reduce__ method to make sure that it's possible customize
-             * pickling in sub-classes. */
-            subclass_array_reduce = PyObject_GetAttrString((PyObject *)self,
-                                                           "__reduce__");
-            return PyObject_CallObject(subclass_array_reduce, unused);
-        }
-        else if (protocol == 5){
-            ret = PyTuple_New(2);
-
-            if (ret == NULL) {
-                return NULL;
-            }
+    descr = PyArray_DESCR(self);
 
-            /* if the python version is below 3.8, the pickle module does not provide
-             * built-in support for protocol 5. We try importing the pickle5
-             * backport instead */
+    /* if the python version is below 3.8, the pickle module does not provide
+     * built-in support for protocol 5. We try importing the pickle5
+     * backport instead */
 #if PY_VERSION_HEX >= 0x03080000
-            pickle_module = PyImport_ImportModule("pickle");
-#elif PY_VERSION_HEX < 0x03080000 && PY_VERSION_HEX >= 0x03060000
-            pickle_module = PyImport_ImportModule("pickle5");
-            if (pickle_module == NULL){
-                /* for protocol 5, raise a clear ImportError if pickle5 is not found
-                 */
-                PyErr_SetString(PyExc_ImportError, "Using pickle protocol 5 "
-                        "requires the pickle5 module for python versions >=3.6 "
-                        "and <3.8");
-                return NULL;
-            }
+    /* we expect protocol 5 to be available in Python 3.8 */
+    pickle_module = PyImport_ImportModule("pickle");
+#elif PY_VERSION_HEX >= 0x03060000
+    pickle_module = PyImport_ImportModule("pickle5");
+    if (pickle_module == NULL) {
+        /* for protocol 5, raise a clear ImportError if pickle5 is not found
+         */
+        PyErr_SetString(PyExc_ImportError, "Using pickle protocol 5 "
+                "requires the pickle5 module for Python >=3.6 and <3.8");
+        return NULL;
+    }
 #else
-            PyErr_SetString(PyExc_ValueError, "pickle protocol 5 is not available "
-                                               "for python versions < 3.6");
-            return NULL;
+    PyErr_SetString(PyExc_ValueError, "pickle protocol 5 is not available "
+                                      "for Python < 3.6");
+    return NULL;
 #endif
-            if (pickle_module == NULL){
-                return NULL;
-            }
-
-            pickle_class = PyObject_GetAttrString(pickle_module,
-                                                  "PickleBuffer");
+    if (pickle_module == NULL){
+        return NULL;
+    }
+    picklebuf_class = PyObject_GetAttrString(pickle_module, "PickleBuffer");
+    Py_DECREF(pickle_module);
+    if (picklebuf_class == NULL) {
+        return NULL;
+    }
 
-            class_args_tuple = PyTuple_New(1);
-            if (!PyArray_IS_C_CONTIGUOUS((PyArrayObject*)self) &&
-                PyArray_IS_F_CONTIGUOUS((PyArrayObject*)self)){
+    /* Construct a PickleBuffer of the array */
 
-                /* if the array if Fortran-contiguous and not C-contiguous,
-                 * the PickleBuffer instance will hold a view on the transpose
-                 * of the initial array, that is C-contiguous. */
-                order = 'F';
-                transposed_array = PyArray_Transpose((PyArrayObject*)self, NULL);
-                PyTuple_SET_ITEM(class_args_tuple, 0, transposed_array);
-            }
-            else {
-                order = 'C';
-                PyTuple_SET_ITEM(class_args_tuple, 0, (PyObject *)self);
-                Py_INCREF(self);
-            }
+    if (!PyArray_IS_C_CONTIGUOUS((PyArrayObject*) self) &&
+         PyArray_IS_F_CONTIGUOUS((PyArrayObject*) self)) {
+        /* if the array if Fortran-contiguous and not C-contiguous,
+         * the PickleBuffer instance will hold a view on the transpose
+         * of the initial array, that is C-contiguous. */
+        order = 'F';
+        transposed_array = PyArray_Transpose((PyArrayObject*)self, NULL);
+        picklebuf_args = Py_BuildValue("(N)", transposed_array);
+    }
+    else {
+        order = 'C';
+        picklebuf_args = Py_BuildValue("(O)", self);
+    }
+    if (picklebuf_args == NULL) {
+        Py_DECREF(picklebuf_class);
+        return NULL;
+    }
 
-            class_args = Py_BuildValue("O", class_args_tuple);
+    buffer = PyObject_CallObject(picklebuf_class, picklebuf_args);
+    Py_DECREF(picklebuf_class);
+    Py_DECREF(picklebuf_args);
+    if (buffer == NULL) {
+        /* Some arrays may refuse to export a buffer, in which case
+         * just fall back on regular __reduce_ex__ implementation
+         * (gh-12745).
+         */
+        PyErr_Clear();
+        return array_reduce_ex_regular(self, protocol);
+    }
 
-            buffer = PyObject_CallObject(pickle_class, class_args);
+    /* Get the _frombuffer() function for reconstruction */
 
-            numeric_mod = PyImport_ImportModule("numpy.core.numeric");
-            if (numeric_mod == NULL) {
-                Py_DECREF(ret);
-                return NULL;
-            }
-            from_buffer_func = PyObject_GetAttrString(numeric_mod,
-                                                      "_frombuffer");
-            Py_DECREF(numeric_mod);
+    numeric_mod = PyImport_ImportModule("numpy.core.numeric");
+    if (numeric_mod == NULL) {
+        Py_DECREF(buffer);
+        return NULL;
+    }
+    from_buffer_func = PyObject_GetAttrString(numeric_mod,
+                                              "_frombuffer");
+    Py_DECREF(numeric_mod);
+    if (from_buffer_func == NULL) {
+        Py_DECREF(buffer);
+        return NULL;
+    }
 
-            Py_INCREF(descr);
+    return Py_BuildValue("N(NONN)",
+                         from_buffer_func, buffer, (PyObject *)descr,
+                         PyObject_GetAttrString((PyObject *)self, "shape"),
+                         PyUnicode_FromStringAndSize(&order, 1));
+}
 
-            buffer_tuple = PyTuple_New(4);
-            PyTuple_SET_ITEM(buffer_tuple, 0, buffer);
-            PyTuple_SET_ITEM(buffer_tuple, 1, (PyObject *)descr);
-            PyTuple_SET_ITEM(buffer_tuple, 2,
-                             PyObject_GetAttrString((PyObject *)self,
-                                                    "shape"));
-            PyTuple_SET_ITEM(buffer_tuple, 3,
-                             PyUnicode_FromStringAndSize(&order,
-                                                         (Py_ssize_t)1));
+static PyObject *
+array_reduce_ex(PyArrayObject *self, PyObject *args)
+{
+    int protocol;
+    PyArray_Descr *descr = NULL;
 
-            PyTuple_SET_ITEM(ret, 0, from_buffer_func);
-            PyTuple_SET_ITEM(ret, 1, buffer_tuple);
+    if (!PyArg_ParseTuple(args, "i", &protocol)) {
+        return NULL;
+    }
 
-            return ret;
-        }
-        else {
-            PyErr_Format(PyExc_ValueError,
-                         "cannot call __reduce_ex__ with protocol >= %d",
-                         5);
-            return NULL;
-        }
+    descr = PyArray_DESCR(self);
+    if ((protocol < 5) ||
+        (!PyArray_IS_C_CONTIGUOUS((PyArrayObject*)self) &&
+         !PyArray_IS_F_CONTIGUOUS((PyArrayObject*)self)) ||
+        PyDataType_FLAGCHK(descr, NPY_ITEM_HASOBJECT) ||
+        (PyType_IsSubtype(((PyObject*)self)->ob_type, &PyArray_Type) &&
+         ((PyObject*)self)->ob_type != &PyArray_Type) ||
+        PyDataType_ISUNSIZED(descr)) {
+        /* The PickleBuffer class from version 5 of the pickle protocol
+         * can only be used for arrays backed by a contiguous data buffer.
+         * For all other cases we fallback to the generic array_reduce
+         * method that involves using a temporary bytes allocation. */
+        return array_reduce_ex_regular(self, protocol);
+    }
+    else if (protocol == 5) {
+        return array_reduce_ex_picklebuffer(self, protocol);
     }
     else {
+        PyErr_Format(PyExc_ValueError,
+                     "__reduce_ex__ called with protocol > 5");
         return NULL;
     }
-
 }
 
 static PyObject *
diff --git a/numpy/core/src/multiarray/multiarraymodule.c b/numpy/core/src/multiarray/multiarraymodule.c
index 8135769d9893b3efc8149dae11c7b50b1907e510..166533b3fb04451941d24c215f2f87550fd9dd12 100644
--- a/numpy/core/src/multiarray/multiarraymodule.c
+++ b/numpy/core/src/multiarray/multiarraymodule.c
@@ -34,6 +34,7 @@
 NPY_NO_EXPORT int NPY_NUMUSERTYPES = 0;
 
 /* Internal APIs */
+#include "arrayfunction_override.h"
 #include "arraytypes.h"
 #include "arrayobject.h"
 #include "hashdescr.h"
@@ -3254,6 +3255,7 @@ array_datetime_data(PyObject *NPY_UNUSED(dummy), PyObject *args)
     }
 
     meta = get_datetime_metadata_from_dtype(dtype);
+    Py_DECREF(dtype);    
     if (meta == NULL) {
         return NULL;
     }
@@ -3618,6 +3620,7 @@ _vec_string_with_args(PyArrayObject* char_array, PyArray_Descr* type,
     if (nargs == -1 || nargs > NPY_MAXARGS) {
         PyErr_Format(PyExc_ValueError,
                 "len(args) must be < %d", NPY_MAXARGS - 1);
+        Py_DECREF(type);
         goto err;
     }
 
@@ -3625,6 +3628,7 @@ _vec_string_with_args(PyArrayObject* char_array, PyArray_Descr* type,
     for (i = 1; i < nargs; i++) {
         PyObject* item = PySequence_GetItem(args, i-1);
         if (item == NULL) {
+            Py_DECREF(type);
             goto err;
         }
         broadcast_args[i] = item;
@@ -3633,6 +3637,7 @@ _vec_string_with_args(PyArrayObject* char_array, PyArray_Descr* type,
     in_iter = (PyArrayMultiIterObject*)PyArray_MultiIterFromObjects
         (broadcast_args, nargs, 0);
     if (in_iter == NULL) {
+        Py_DECREF(type);
         goto err;
     }
     n = in_iter->numiter;
@@ -3713,6 +3718,7 @@ _vec_string_no_args(PyArrayObject* char_array,
 
     in_iter = (PyArrayIterObject*)PyArray_IterNew((PyObject*)char_array);
     if (in_iter == NULL) {
+        Py_DECREF(type);
         goto err;
     }
 
@@ -3769,7 +3775,7 @@ static PyObject *
 _vec_string(PyObject *NPY_UNUSED(dummy), PyObject *args, PyObject *kwds)
 {
     PyArrayObject* char_array = NULL;
-    PyArray_Descr *type = NULL;
+    PyArray_Descr *type;
     PyObject* method_name;
     PyObject* args_seq = NULL;
 
@@ -3806,6 +3812,7 @@ _vec_string(PyObject *NPY_UNUSED(dummy), PyObject *args, PyObject *kwds)
         result = _vec_string_with_args(char_array, type, method, args_seq);
     }
     else {
+        Py_DECREF(type);
         PyErr_SetString(PyExc_TypeError,
                 "'args' must be a sequence of arguments");
         goto err;
@@ -4062,6 +4069,9 @@ normalize_axis_index(PyObject *NPY_UNUSED(self), PyObject *args, PyObject *kwds)
 }
 
 static struct PyMethodDef array_module_methods[] = {
+    {"_get_implementing_args",
+        (PyCFunction)array__get_implementing_args,
+        METH_VARARGS, NULL},
     {"_get_ndarray_c_version",
         (PyCFunction)array__get_ndarray_c_version,
         METH_VARARGS|METH_KEYWORDS, NULL},
@@ -4224,6 +4234,9 @@ static struct PyMethodDef array_module_methods[] = {
         METH_VARARGS | METH_KEYWORDS, NULL},
     {"_monotonicity", (PyCFunction)arr__monotonicity,
         METH_VARARGS | METH_KEYWORDS, NULL},
+    {"implement_array_function",
+        (PyCFunction)array_implement_array_function,
+        METH_VARARGS, NULL},
     {"interp", (PyCFunction)arr_interp,
         METH_VARARGS | METH_KEYWORDS, NULL},
     {"interp_complex", (PyCFunction)arr_interp_complex,
@@ -4476,6 +4489,7 @@ NPY_VISIBILITY_HIDDEN PyObject * npy_ma_str_array_wrap = NULL;
 NPY_VISIBILITY_HIDDEN PyObject * npy_ma_str_array_finalize = NULL;
 NPY_VISIBILITY_HIDDEN PyObject * npy_ma_str_buffer = NULL;
 NPY_VISIBILITY_HIDDEN PyObject * npy_ma_str_ufunc = NULL;
+NPY_VISIBILITY_HIDDEN PyObject * npy_ma_str_wrapped = NULL;
 NPY_VISIBILITY_HIDDEN PyObject * npy_ma_str_order = NULL;
 NPY_VISIBILITY_HIDDEN PyObject * npy_ma_str_copy = NULL;
 NPY_VISIBILITY_HIDDEN PyObject * npy_ma_str_dtype = NULL;
@@ -4492,6 +4506,7 @@ intern_strings(void)
     npy_ma_str_array_finalize = PyUString_InternFromString("__array_finalize__");
     npy_ma_str_buffer = PyUString_InternFromString("__buffer__");
     npy_ma_str_ufunc = PyUString_InternFromString("__array_ufunc__");
+    npy_ma_str_wrapped = PyUString_InternFromString("__wrapped__");
     npy_ma_str_order = PyUString_InternFromString("order");
     npy_ma_str_copy = PyUString_InternFromString("copy");
     npy_ma_str_dtype = PyUString_InternFromString("dtype");
@@ -4501,7 +4516,7 @@ intern_strings(void)
 
     return npy_ma_str_array && npy_ma_str_array_prepare &&
            npy_ma_str_array_wrap && npy_ma_str_array_finalize &&
-           npy_ma_str_buffer && npy_ma_str_ufunc &&
+           npy_ma_str_buffer && npy_ma_str_ufunc && npy_ma_str_wrapped &&
            npy_ma_str_order && npy_ma_str_copy && npy_ma_str_dtype &&
            npy_ma_str_ndmin && npy_ma_str_axis1 && npy_ma_str_axis2;
 }
diff --git a/numpy/core/src/multiarray/multiarraymodule.h b/numpy/core/src/multiarray/multiarraymodule.h
index 3de68c5498109bbf00d585340830c20eee972296..60a3965c9894b6e745607cb2dfd5ff15dbb27c43 100644
--- a/numpy/core/src/multiarray/multiarraymodule.h
+++ b/numpy/core/src/multiarray/multiarraymodule.h
@@ -7,6 +7,7 @@ NPY_VISIBILITY_HIDDEN extern PyObject * npy_ma_str_array_wrap;
 NPY_VISIBILITY_HIDDEN extern PyObject * npy_ma_str_array_finalize;
 NPY_VISIBILITY_HIDDEN extern PyObject * npy_ma_str_buffer;
 NPY_VISIBILITY_HIDDEN extern PyObject * npy_ma_str_ufunc;
+NPY_VISIBILITY_HIDDEN extern PyObject * npy_ma_str_wrapped;
 NPY_VISIBILITY_HIDDEN extern PyObject * npy_ma_str_order;
 NPY_VISIBILITY_HIDDEN extern PyObject * npy_ma_str_copy;
 NPY_VISIBILITY_HIDDEN extern PyObject * npy_ma_str_dtype;
diff --git a/numpy/core/src/multiarray/nditer_constr.c b/numpy/core/src/multiarray/nditer_constr.c
index 90cff4077d43f950038056a39e10c15a522ed473..18a2cc84fb45b8dc9151ce16a5251caef3b5e56d 100644
--- a/numpy/core/src/multiarray/nditer_constr.c
+++ b/numpy/core/src/multiarray/nditer_constr.c
@@ -1248,9 +1248,9 @@ npyiter_prepare_operands(int nop, PyArrayObject **op_in,
     return 1;
 
   fail_nop:
-    iop = nop;
+    iop = nop - 1;
   fail_iop:
-    for (i = 0; i < iop; ++i) {
+    for (i = 0; i < iop+1; ++i) {
         Py_XDECREF(op[i]);
         Py_XDECREF(op_dtype[i]);
     }
@@ -3175,6 +3175,7 @@ npyiter_allocate_transfer_functions(NpyIter *iter)
                                         &stransfer,
                                         &transferdata,
                                         &needs_api) != NPY_SUCCEED) {
+                    iop -= 1;  /* This one cannot be cleaned up yet. */
                     goto fail;
                 }
                 readtransferfn[iop] = stransfer;
@@ -3268,7 +3269,7 @@ npyiter_allocate_transfer_functions(NpyIter *iter)
     return 1;
 
 fail:
-    for (i = 0; i < iop; ++i) {
+    for (i = 0; i < iop+1; ++i) {
         if (readtransferdata[iop] != NULL) {
             NPY_AUXDATA_FREE(readtransferdata[iop]);
             readtransferdata[iop] = NULL;
diff --git a/numpy/core/src/multiarray/nditer_pywrap.c b/numpy/core/src/multiarray/nditer_pywrap.c
index 5a9f3c5fae238f2124e6b60610191f0524ef8f27..30a81e0ca64d750aa461ef489cf523982d9f689f 100644
--- a/numpy/core/src/multiarray/nditer_pywrap.c
+++ b/numpy/core/src/multiarray/nditer_pywrap.c
@@ -2355,6 +2355,8 @@ npyiter_close(NewNpyArrayIterObject *self)
     }
     ret = NpyIter_Deallocate(iter);
     self->iter = NULL;
+    Py_XDECREF(self->nested_child);
+    self->nested_child = NULL;
     if (ret < 0) {
         return NULL;
     }
diff --git a/numpy/core/src/multiarray/number.c b/numpy/core/src/multiarray/number.c
index d153a8a64fa108964157867e4ef51c30697e4134..420501ce251f0b3289e12a6ea04ba57e92255857 100644
--- a/numpy/core/src/multiarray/number.c
+++ b/numpy/core/src/multiarray/number.c
@@ -599,15 +599,16 @@ array_positive(PyArrayObject *m1)
             PyErr_Restore(exc, val, tb);
             return NULL;
         }
+        Py_XDECREF(exc);
+        Py_XDECREF(val);
+        Py_XDECREF(tb);
+
         /* 2018-06-28, 1.16.0 */
         if (DEPRECATE("Applying '+' to a non-numerical array is "
                       "ill-defined. Returning a copy, but in the future "
                       "this will error.") < 0) {
             return NULL;
         }
-        Py_XDECREF(exc);
-        Py_XDECREF(val);
-        Py_XDECREF(tb);
         value = PyArray_Return((PyArrayObject *)PyArray_Copy(m1));
     }
     return value;
diff --git a/numpy/core/src/multiarray/refcount.c b/numpy/core/src/multiarray/refcount.c
index 4b018b056719de55f9b101b9ddf665be515a78af..b8230c81a58f597a82144caec73f7f7841207974 100644
--- a/numpy/core/src/multiarray/refcount.c
+++ b/numpy/core/src/multiarray/refcount.c
@@ -19,8 +19,12 @@
 static void
 _fillobject(char *optr, PyObject *obj, PyArray_Descr *dtype);
 
-/* Incref all objects found at this record */
+
 /*NUMPY_API
+ * XINCREF all objects in a single array item. This is complicated for
+ * structured datatypes where the position of objects needs to be extracted.
+ * The function is execute recursively for each nested field or subarrays dtype
+ * such as as `np.dtype([("field1", "O"), ("field2", "f,O", (3,2))])`
  */
 NPY_NO_EXPORT void
 PyArray_Item_INCREF(char *data, PyArray_Descr *descr)
@@ -51,11 +55,37 @@ PyArray_Item_INCREF(char *data, PyArray_Descr *descr)
             PyArray_Item_INCREF(data + offset, new);
         }
     }
+    else if (PyDataType_HASSUBARRAY(descr)) {
+        int size, i, inner_elsize;
+
+        inner_elsize = descr->subarray->base->elsize;
+        if (inner_elsize == 0) {
+            /* There cannot be any elements, so return */
+            return;
+        }
+        /* Subarrays are always contiguous in memory */
+        size = descr->elsize / inner_elsize;
+
+        for (i = 0; i < size; i++){
+            /* Recursively increment the reference count of subarray elements */
+            PyArray_Item_INCREF(data + i * inner_elsize,
+                                descr->subarray->base);
+        }
+    }
+    else {
+        /* This path should not be reachable. */
+        assert(0);
+    }
     return;
 }
 
-/* XDECREF all objects found at this record */
+
 /*NUMPY_API
+ *
+ * XDECREF all objects in a single array item. This is complicated for
+ * structured datatypes where the position of objects needs to be extracted.
+ * The function is execute recursively for each nested field or subarrays dtype
+ * such as as `np.dtype([("field1", "O"), ("field2", "f,O", (3,2))])`
  */
 NPY_NO_EXPORT void
 PyArray_Item_XDECREF(char *data, PyArray_Descr *descr)
@@ -87,6 +117,27 @@ PyArray_Item_XDECREF(char *data, PyArray_Descr *descr)
                 PyArray_Item_XDECREF(data + offset, new);
             }
         }
+    else if (PyDataType_HASSUBARRAY(descr)) {
+        int size, i, inner_elsize;
+
+        inner_elsize = descr->subarray->base->elsize;
+        if (inner_elsize == 0) {
+            /* There cannot be any elements, so return */
+            return;
+        }
+        /* Subarrays are always contiguous in memory */
+        size = descr->elsize / inner_elsize;
+
+        for (i = 0; i < size; i++){
+            /* Recursively decrement the reference count of subarray elements */
+            PyArray_Item_XDECREF(data + i * inner_elsize,
+                                 descr->subarray->base);
+        }
+    }
+    else {
+        /* This path should not be reachable. */
+        assert(0);
+    }
     return;
 }
 
@@ -258,6 +309,10 @@ _fillobject(char *optr, PyObject *obj, PyArray_Descr *dtype)
             Py_XDECREF(arr);
         }
     }
+    if (dtype->type_num == NPY_OBJECT) {
+        Py_XINCREF(obj);
+        NPY_COPY_PYOBJECT_PTR(optr, &obj);
+    }
     else if (PyDataType_HASFIELDS(dtype)) {
         PyObject *key, *value, *title = NULL;
         PyArray_Descr *new;
@@ -274,15 +329,26 @@ _fillobject(char *optr, PyObject *obj, PyArray_Descr *dtype)
             _fillobject(optr + offset, obj, new);
         }
     }
-    else {
-        npy_intp i;
-        npy_intp nsize = dtype->elsize / sizeof(obj);
+    else if (PyDataType_HASSUBARRAY(dtype)) {
+        int size, i, inner_elsize;
 
-        for (i = 0; i < nsize; i++) {
-            Py_XINCREF(obj);
-            NPY_COPY_PYOBJECT_PTR(optr, &obj);
-            optr += sizeof(obj);
+        inner_elsize = dtype->subarray->base->elsize;
+        if (inner_elsize == 0) {
+            /* There cannot be any elements, so return */
+            return;
+        }
+        /* Subarrays are always contiguous in memory */
+        size = dtype->elsize / inner_elsize;
+
+        /* Call _fillobject on each item recursively. */
+        for (i = 0; i < size; i++){
+            _fillobject(optr, obj, dtype->subarray->base);
+            optr += inner_elsize;
         }
-        return;
     }
+    else {
+        /* This path should not be reachable. */
+        assert(0);
+    }
+    return;
 }
diff --git a/numpy/core/src/multiarray/scalartypes.c.src b/numpy/core/src/multiarray/scalartypes.c.src
index 2f71c8ae974677b494a596911cf2d4c8f3b3fe1d..52de31289d0368de128ff6e8bf5ef1d3f6a91b29 100644
--- a/numpy/core/src/multiarray/scalartypes.c.src
+++ b/numpy/core/src/multiarray/scalartypes.c.src
@@ -2599,6 +2599,8 @@ NPY_NO_EXPORT PyTypeObject PyGenericArrType_Type = {
 static void
 void_dealloc(PyVoidScalarObject *v)
 {
+    _dealloc_cached_buffer_info((PyObject *)v);
+
     if (v->flags & NPY_ARRAY_OWNDATA) {
         npy_free_cache(v->obval, Py_SIZE(v));
     }
diff --git a/numpy/core/src/multiarray/usertypes.c b/numpy/core/src/multiarray/usertypes.c
index 8e8090002780c7eba3d010790aae7899fda2c17b..2e8fb514f337a5efc9a7f78820affaba94b489ee 100644
--- a/numpy/core/src/multiarray/usertypes.c
+++ b/numpy/core/src/multiarray/usertypes.c
@@ -40,19 +40,27 @@ maintainer email:  oliphant.travis@ieee.org
 
 NPY_NO_EXPORT PyArray_Descr **userdescrs=NULL;
 
-static int *
-_append_new(int *types, int insert)
+static int
+_append_new(int **p_types, int insert)
 {
     int n = 0;
     int *newtypes;
+    int *types = *p_types;
 
     while (types[n] != NPY_NOTYPE) {
         n++;
     }
     newtypes = (int *)realloc(types, (n + 2)*sizeof(int));
+    if (newtypes == NULL) {
+        PyErr_NoMemory();
+        return -1;
+    }
     newtypes[n] = insert;
     newtypes[n + 1] = NPY_NOTYPE;
-    return newtypes;
+
+    /* Replace the passed-in pointer */
+    *p_types = newtypes;
+    return 0;
 }
 
 static npy_bool
@@ -247,10 +255,13 @@ PyArray_RegisterCanCast(PyArray_Descr *descr, int totype,
          */
         if (descr->f->cancastto == NULL) {
             descr->f->cancastto = (int *)malloc(1*sizeof(int));
+            if (descr->f->cancastto == NULL) {
+                PyErr_NoMemory();
+                return -1;
+            }
             descr->f->cancastto[0] = NPY_NOTYPE;
         }
-        descr->f->cancastto = _append_new(descr->f->cancastto,
-                                          totype);
+        return _append_new(&descr->f->cancastto, totype);
     }
     else {
         /* register with cancastscalarkindto */
@@ -258,6 +269,10 @@ PyArray_RegisterCanCast(PyArray_Descr *descr, int totype,
             int i;
             descr->f->cancastscalarkindto =
                 (int **)malloc(NPY_NSCALARKINDS* sizeof(int*));
+            if (descr->f->cancastscalarkindto == NULL) {
+                PyErr_NoMemory();
+                return -1;
+            }
             for (i = 0; i < NPY_NSCALARKINDS; i++) {
                 descr->f->cancastscalarkindto[i] = NULL;
             }
@@ -265,11 +280,13 @@ PyArray_RegisterCanCast(PyArray_Descr *descr, int totype,
         if (descr->f->cancastscalarkindto[scalar] == NULL) {
             descr->f->cancastscalarkindto[scalar] =
                 (int *)malloc(1*sizeof(int));
+            if (descr->f->cancastscalarkindto[scalar] == NULL) {
+                PyErr_NoMemory();
+                return -1;
+            }
             descr->f->cancastscalarkindto[scalar][0] =
                 NPY_NOTYPE;
         }
-        descr->f->cancastscalarkindto[scalar] =
-            _append_new(descr->f->cancastscalarkindto[scalar], totype);
+        return _append_new(&descr->f->cancastscalarkindto[scalar], totype);
     }
-    return 0;
 }
diff --git a/numpy/core/src/npymath/halffloat.c b/numpy/core/src/npymath/halffloat.c
index c2bd28d60fc7d54ca739372d4e341627cfe2b0fc..84af86009752b98efde4dff82b4bb346756685b2 100644
--- a/numpy/core/src/npymath/halffloat.c
+++ b/numpy/core/src/npymath/halffloat.c
@@ -301,15 +301,23 @@ npy_uint16 npy_floatbits_to_halfbits(npy_uint32 f)
             npy_set_floatstatus_underflow();
         }
 #endif
+        /*
+         * Usually the significand is shifted by 13. For subnormals an
+         * additional shift needs to occur. This shift is one for the largest
+         * exponent giving a subnormal `f_exp = 0x38000000 >> 23 = 112`, which
+         * offsets the new first bit. At most the shift can be 1+10 bits.
+         */
         f_sig >>= (113 - f_exp);
         /* Handle rounding by adding 1 to the bit beyond half precision */
 #if NPY_HALF_ROUND_TIES_TO_EVEN
         /*
          * If the last bit in the half significand is 0 (already even), and
          * the remaining bit pattern is 1000...0, then we do not add one
-         * to the bit after the half significand.  In all other cases, we do.
+         * to the bit after the half significand. However, the (113 - f_exp)
+         * shift can lose up to 11 bits, so the || checks them in the original.
+         * In all other cases, we can just add one.
          */
-        if ((f_sig&0x00003fffu) != 0x00001000u) {
+        if (((f_sig&0x00003fffu) != 0x00001000u) || (f&0x000007ffu)) {
             f_sig += 0x00001000u;
         }
 #else
@@ -416,7 +424,16 @@ npy_uint16 npy_doublebits_to_halfbits(npy_uint64 d)
             npy_set_floatstatus_underflow();
         }
 #endif
-        d_sig >>= (1009 - d_exp);
+        /*
+         * Unlike floats, doubles have enough room to shift left to align
+         * the subnormal significand leading to no loss of the last bits.
+         * The smallest possible exponent giving a subnormal is:
+         * `d_exp = 0x3e60000000000000 >> 52 = 998`. All larger subnormals are
+         * shifted with respect to it. This adds a shift of 10+1 bits the final
+         * right shift when comparing it to the one in the normal branch.
+         */
+        assert(d_exp - 998 >= 0);
+        d_sig <<= (d_exp - 998);
         /* Handle rounding by adding 1 to the bit beyond half precision */
 #if NPY_HALF_ROUND_TIES_TO_EVEN
         /*
@@ -424,13 +441,13 @@ npy_uint16 npy_doublebits_to_halfbits(npy_uint64 d)
          * the remaining bit pattern is 1000...0, then we do not add one
          * to the bit after the half significand.  In all other cases, we do.
          */
-        if ((d_sig&0x000007ffffffffffULL) != 0x0000020000000000ULL) {
-            d_sig += 0x0000020000000000ULL;
+        if ((d_sig&0x003fffffffffffffULL) != 0x0010000000000000ULL) {
+            d_sig += 0x0010000000000000ULL;
         }
 #else
-        d_sig += 0x0000020000000000ULL;
+        d_sig += 0x0010000000000000ULL;
 #endif
-        h_sig = (npy_uint16) (d_sig >> 42);
+        h_sig = (npy_uint16) (d_sig >> 53);
         /*
          * If the rounding causes a bit to spill into h_exp, it will
          * increment h_exp from zero to one and h_sig will be zero.
diff --git a/numpy/core/src/umath/_struct_ufunc_tests.c.src b/numpy/core/src/umath/_struct_ufunc_tests.c.src
index b831d5c2aa528abfb7f9e18424048acc65ee4bec..5c6e235e01b80d6305ada53b3234d3db09b73977 100644
--- a/numpy/core/src/umath/_struct_ufunc_tests.c.src
+++ b/numpy/core/src/umath/_struct_ufunc_tests.c.src
@@ -114,6 +114,7 @@ PyMODINIT_FUNC init_struct_ufunc_tests(void)
                                 dtypes,
                                 NULL);
 
+    Py_DECREF(dtype);
     d = PyModule_GetDict(m);
 
     PyDict_SetItemString(d, "add_triplet", add_triplet);
diff --git a/numpy/core/src/umath/_umath_tests.c.src b/numpy/core/src/umath/_umath_tests.c.src
index 8cb74f177fd2e199df550ea65a8f2780de4cdb4d..6c3bcce7133a7daff2c7f1eab706964afa38a226 100644
--- a/numpy/core/src/umath/_umath_tests.c.src
+++ b/numpy/core/src/umath/_umath_tests.c.src
@@ -564,7 +564,7 @@ UMath_Tests_test_signature(PyObject *NPY_UNUSED(dummy), PyObject *args)
         core_dim_sizes = Py_None;
     }
     Py_DECREF(f);
-    return Py_BuildValue("iOOOO", core_enabled, core_num_dims,
+    return Py_BuildValue("iNNNN", core_enabled, core_num_dims,
                          core_dim_ixs, core_dim_flags, core_dim_sizes);
 
 fail:
diff --git a/numpy/core/src/umath/loops.c.src b/numpy/core/src/umath/loops.c.src
index ae3ece77bb71628aa1496acdb1d37a46cbff2817..975a5e6b833204ac86cf668e49021e157bc35050 100644
--- a/numpy/core/src/umath/loops.c.src
+++ b/numpy/core/src/umath/loops.c.src
@@ -1603,7 +1603,7 @@ TIMEDELTA_mm_m_remainder(char **args, npy_intp *dimensions, npy_intp *steps, voi
         else {
             if (in2 == 0) {
                 npy_set_floatstatus_divbyzero();
-                *((npy_timedelta *)op1) = 0;
+                *((npy_timedelta *)op1) = NPY_DATETIME_NAT;
             }
             else {
                 /* handle mixed case the way Python does */
@@ -1619,6 +1619,62 @@ TIMEDELTA_mm_m_remainder(char **args, npy_intp *dimensions, npy_intp *steps, voi
     }
 }
 
+NPY_NO_EXPORT void
+TIMEDELTA_mm_q_floor_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
+{
+    BINARY_LOOP {
+        const npy_timedelta in1 = *(npy_timedelta *)ip1;
+        const npy_timedelta in2 = *(npy_timedelta *)ip2;
+        if (in1 == NPY_DATETIME_NAT || in2 == NPY_DATETIME_NAT) {
+            npy_set_floatstatus_invalid();
+            *((npy_int64 *)op1) = 0;
+        }
+        else if (in2 == 0) {
+            npy_set_floatstatus_divbyzero();
+            *((npy_int64 *)op1) = 0;
+        }
+        else {
+            if (((in1 > 0) != (in2 > 0)) && (in1 % in2 != 0)) {
+                *((npy_int64 *)op1) = in1/in2 - 1;
+            }
+            else {
+                *((npy_int64 *)op1) = in1/in2;
+            }
+        }
+    }
+}
+
+NPY_NO_EXPORT void
+TIMEDELTA_mm_qm_divmod(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
+{
+    BINARY_LOOP_TWO_OUT {
+        const npy_timedelta in1 = *(npy_timedelta *)ip1;
+        const npy_timedelta in2 = *(npy_timedelta *)ip2;
+        if (in1 == NPY_DATETIME_NAT || in2 == NPY_DATETIME_NAT) {
+            npy_set_floatstatus_invalid();
+            *((npy_int64 *)op1) = 0;
+            *((npy_timedelta *)op2) = NPY_DATETIME_NAT;
+        }
+        else if (in2 == 0) {
+            npy_set_floatstatus_divbyzero();
+            *((npy_int64 *)op1) = 0;
+            *((npy_timedelta *)op2) = NPY_DATETIME_NAT;
+        }
+        else {
+            const npy_int64 quo = in1 / in2;
+            const npy_timedelta rem = in1 % in2;
+            if ((in1 > 0) == (in2 > 0) || rem == 0) {
+                *((npy_int64 *)op1) = quo;
+                *((npy_timedelta *)op2) = rem;
+            }
+            else {
+                *((npy_int64 *)op1) = quo - 1;
+                *((npy_timedelta *)op2) = rem + in2;
+            }
+        }
+    }
+}
+
 /*
  *****************************************************************************
  **                             FLOAT LOOPS                                 **
diff --git a/numpy/core/src/umath/loops.h.src b/numpy/core/src/umath/loops.h.src
index 9b6327308fe550d79ed9fe81a7a9e593372ac867..5264a6533ee848fccd0ea2c1d87bd1d0daa8fad8 100644
--- a/numpy/core/src/umath/loops.h.src
+++ b/numpy/core/src/umath/loops.h.src
@@ -473,9 +473,15 @@ TIMEDELTA_md_m_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *
 NPY_NO_EXPORT void
 TIMEDELTA_mm_d_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
 
+NPY_NO_EXPORT void
+TIMEDELTA_mm_q_floor_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
+
 NPY_NO_EXPORT void
 TIMEDELTA_mm_m_remainder(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
 
+NPY_NO_EXPORT void
+TIMEDELTA_mm_qm_divmod(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
+
 /* Special case equivalents to above functions */
 
 #define TIMEDELTA_mq_m_true_divide TIMEDELTA_mq_m_divide
diff --git a/numpy/core/src/umath/reduction.c b/numpy/core/src/umath/reduction.c
index 6d04ce37224a0f9d33f96c31388ef34c6c4d4c85..791d3693f3c703baa7ef807d079f62279aef2df4 100644
--- a/numpy/core/src/umath/reduction.c
+++ b/numpy/core/src/umath/reduction.c
@@ -186,7 +186,6 @@ conform_reduce_result(int ndim, npy_bool *axis_flags,
             return NULL;
         }
 
-        Py_INCREF(ret);
         if (PyArray_SetWritebackIfCopyBase(ret_copy, (PyArrayObject *)ret) < 0) {
             Py_DECREF(ret);
             Py_DECREF(ret_copy);
diff --git a/numpy/core/src/umath/ufunc_object.c b/numpy/core/src/umath/ufunc_object.c
index a2df5869838f3e9f3eb74e91db2a7173b3beb0b8..1ab48bb903f3bdcbb79ba246797dd4f620f3fb67 100644
--- a/numpy/core/src/umath/ufunc_object.c
+++ b/numpy/core/src/umath/ufunc_object.c
@@ -3063,6 +3063,8 @@ PyUFunc_GeneralizedFunction(PyUFuncObject *ufunc,
     Py_XDECREF(axis);
     Py_XDECREF(full_args.in);
     Py_XDECREF(full_args.out);
+    PyArray_free(remap_axis_memory);
+    PyArray_free(remap_axis);
 
     NPY_UF_DBG_PRINT1("Returning code %d\n", retval);
 
diff --git a/numpy/core/src/umath/ufunc_type_resolution.c b/numpy/core/src/umath/ufunc_type_resolution.c
index ec60d9cfd0a4ab4df8041cf523430b152826ba54..c2d81fc5d990355ea3c66b5d1c6548643d0ef501 100644
--- a/numpy/core/src/umath/ufunc_type_resolution.c
+++ b/numpy/core/src/umath/ufunc_type_resolution.c
@@ -1114,7 +1114,16 @@ PyUFunc_DivisionTypeResolver(PyUFuncObject *ufunc,
             }
             out_dtypes[1] = out_dtypes[0];
             Py_INCREF(out_dtypes[1]);
+
+            /*
+             * TODO: split function into truediv and floordiv resolvers
+             */
+            if (strcmp(ufunc->name, "floor_divide") == 0) {
+                out_dtypes[2] = PyArray_DescrFromType(NPY_LONGLONG);
+            }
+            else {
             out_dtypes[2] = PyArray_DescrFromType(NPY_DOUBLE);
+            }
             if (out_dtypes[2] == NULL) {
                 Py_DECREF(out_dtypes[0]);
                 out_dtypes[0] = NULL;
@@ -2247,3 +2256,52 @@ type_tuple_type_resolver(PyUFuncObject *self,
 
     return -1;
 }
+
+NPY_NO_EXPORT int
+PyUFunc_DivmodTypeResolver(PyUFuncObject *ufunc,
+                                NPY_CASTING casting,
+                                PyArrayObject **operands,
+                                PyObject *type_tup,
+                                PyArray_Descr **out_dtypes)
+{
+    int type_num1, type_num2;
+    int i;
+
+    type_num1 = PyArray_DESCR(operands[0])->type_num;
+    type_num2 = PyArray_DESCR(operands[1])->type_num;
+
+    /* Use the default when datetime and timedelta are not involved */
+    if (!PyTypeNum_ISDATETIME(type_num1) && !PyTypeNum_ISDATETIME(type_num2)) {
+        return PyUFunc_DefaultTypeResolver(ufunc, casting, operands,
+                    type_tup, out_dtypes);
+    }
+    if (type_num1 == NPY_TIMEDELTA) {
+        if (type_num2 == NPY_TIMEDELTA) {
+            out_dtypes[0] = PyArray_PromoteTypes(PyArray_DESCR(operands[0]),
+                                                PyArray_DESCR(operands[1]));
+            out_dtypes[1] = out_dtypes[0];
+            Py_INCREF(out_dtypes[1]);
+            out_dtypes[2] = PyArray_DescrFromType(NPY_LONGLONG);
+            Py_INCREF(out_dtypes[2]);
+            out_dtypes[3] = out_dtypes[0];
+            Py_INCREF(out_dtypes[3]);
+        }
+        else {
+            return raise_binary_type_reso_error(ufunc, operands);
+        }
+    }
+    else {
+        return raise_binary_type_reso_error(ufunc, operands);
+    }
+
+    /* Check against the casting rules */
+    if (PyUFunc_ValidateCasting(ufunc, casting, operands, out_dtypes) < 0) {
+        for (i = 0; i < 4; ++i) {
+            Py_DECREF(out_dtypes[i]);
+            out_dtypes[i] = NULL;
+        }
+        return -1;
+    }
+
+    return 0;
+}
diff --git a/numpy/core/src/umath/ufunc_type_resolution.h b/numpy/core/src/umath/ufunc_type_resolution.h
index 2f37af7532e32cc01f07444e184b10826d8295af..78313b1ef6bf2a9a32e4b5ca2b9c16eb8ec5f58b 100644
--- a/numpy/core/src/umath/ufunc_type_resolution.h
+++ b/numpy/core/src/umath/ufunc_type_resolution.h
@@ -99,6 +99,13 @@ PyUFunc_RemainderTypeResolver(PyUFuncObject *ufunc,
                               PyObject *type_tup,
                               PyArray_Descr **out_dtypes);
 
+NPY_NO_EXPORT int
+PyUFunc_DivmodTypeResolver(PyUFuncObject *ufunc,
+                              NPY_CASTING casting,
+                              PyArrayObject **operands,
+                              PyObject *type_tup,
+                              PyArray_Descr **out_dtypes);
+
 /*
  * Does a linear search for the best inner loop of the ufunc.
  *
diff --git a/numpy/core/src/umath/umathmodule.c b/numpy/core/src/umath/umathmodule.c
index 5de19fec2e237edc8effd7bf0df5cc759e7caf3c..b334a89da113b0d51e8b155b4d90b1b253874706 100644
--- a/numpy/core/src/umath/umathmodule.c
+++ b/numpy/core/src/umath/umathmodule.c
@@ -174,11 +174,17 @@ add_newdoc_ufunc(PyObject *NPY_UNUSED(dummy), PyObject *args)
     char *docstr, *newdocstr;
 
 #if defined(NPY_PY3K)
+    PyObject *tmp;
+
     if (!PyArg_ParseTuple(args, "O!O!:_add_newdoc_ufunc", &PyUFunc_Type, &ufunc,
                                         &PyUnicode_Type, &str)) {
         return NULL;
     }
-    docstr = PyBytes_AS_STRING(PyUnicode_AsUTF8String(str));
+    tmp = PyUnicode_AsUTF8String(str);
+    if (tmp == NULL) {
+        return NULL;
+    }
+    docstr = PyBytes_AS_STRING(tmp);
 #else
     if (!PyArg_ParseTuple(args, "O!O!:_add_newdoc_ufunc", &PyUFunc_Type, &ufunc,
                                          &PyString_Type, &str)) {
@@ -190,6 +196,9 @@ add_newdoc_ufunc(PyObject *NPY_UNUSED(dummy), PyObject *args)
     if (NULL != ufunc->doc) {
         PyErr_SetString(PyExc_ValueError,
                 "Cannot change docstring of ufunc with non-NULL docstring");
+#if defined(NPY_PY3K)
+        Py_DECREF(tmp);
+#endif
         return NULL;
     }
 
@@ -203,6 +212,9 @@ add_newdoc_ufunc(PyObject *NPY_UNUSED(dummy), PyObject *args)
     strcpy(newdocstr, docstr);
     ufunc->doc = newdocstr;
 
+#if defined(NPY_PY3K)
+    Py_DECREF(tmp);
+#endif
     Py_RETURN_NONE;
 }
 
diff --git a/numpy/core/tests/test_arrayprint.py b/numpy/core/tests/test_arrayprint.py
index 7a858d2e22467f1e887c1861d7bce2e3e0988701..f2b8fdca714e846ff851b9ea3c7b564a35dc91fc 100644
--- a/numpy/core/tests/test_arrayprint.py
+++ b/numpy/core/tests/test_arrayprint.py
@@ -90,6 +90,7 @@ class TestArrayRepr(object):
         assert_equal(repr(x),
             'sub(sub(sub(..., dtype=object), dtype=object), dtype=object)')
         assert_equal(str(x), '...')
+        x[()] = 0  # resolve circular references for garbage collector
 
         # nested 0d-subclass-object
         x = sub(None)
@@ -124,11 +125,13 @@ class TestArrayRepr(object):
         arr0d[()] = arr0d
         assert_equal(repr(arr0d),
             'array(array(..., dtype=object), dtype=object)')
+        arr0d[()] = 0  # resolve recursion for garbage collector
 
         arr1d = np.array([None, None])
         arr1d[1] = arr1d
         assert_equal(repr(arr1d),
             'array([None, array(..., dtype=object)], dtype=object)')
+        arr1d[1] = 0  # resolve recursion for garbage collector
 
         first = np.array(None)
         second = np.array(None)
@@ -136,6 +139,7 @@ class TestArrayRepr(object):
         second[()] = first
         assert_equal(repr(first),
             'array(array(array(..., dtype=object), dtype=object), dtype=object)')
+        first[()] = 0  # resolve circular references for garbage collector
 
     def test_containing_list(self):
         # printing square brackets directly would be ambiguuous
diff --git a/numpy/core/tests/test_datetime.py b/numpy/core/tests/test_datetime.py
index b2ce0402ae7c2552c70627bec31cd24a79aa4181..9832b4275103afcc2a2337c2e989a3964089083d 100644
--- a/numpy/core/tests/test_datetime.py
+++ b/numpy/core/tests/test_datetime.py
@@ -1081,6 +1081,133 @@ class TestDateTime(object):
                 check(np.timedelta64(0), f, nat)
                 check(nat, f, nat)
 
+    @pytest.mark.parametrize("op1, op2, exp", [
+        # m8 same units round down
+        (np.timedelta64(7, 's'),
+         np.timedelta64(4, 's'),
+         1),
+        # m8 same units round down with negative
+        (np.timedelta64(7, 's'),
+         np.timedelta64(-4, 's'),
+         -2),
+        # m8 same units negative no round down
+        (np.timedelta64(8, 's'),
+         np.timedelta64(-4, 's'),
+         -2),
+        # m8 different units
+        (np.timedelta64(1, 'm'),
+         np.timedelta64(31, 's'),
+         1),
+        # m8 generic units
+        (np.timedelta64(1890),
+         np.timedelta64(31),
+         60),
+        # Y // M works
+        (np.timedelta64(2, 'Y'),
+         np.timedelta64('13', 'M'),
+         1),
+        # handle 1D arrays
+        (np.array([1, 2, 3], dtype='m8'),
+         np.array([2], dtype='m8'),
+         np.array([0, 1, 1], dtype=np.int64)),
+        ])
+    def test_timedelta_floor_divide(self, op1, op2, exp):
+        assert_equal(op1 // op2, exp)
+
+    @pytest.mark.parametrize("op1, op2", [
+        # div by 0
+        (np.timedelta64(10, 'us'),
+         np.timedelta64(0, 'us')),
+        # div with NaT
+        (np.timedelta64('NaT'),
+         np.timedelta64(50, 'us')),
+        # special case for int64 min
+        # in integer floor division
+        (np.timedelta64(np.iinfo(np.int64).min),
+         np.timedelta64(-1)),
+        ])
+    def test_timedelta_floor_div_warnings(self, op1, op2):
+        with assert_warns(RuntimeWarning):
+            actual = op1 // op2
+            assert_equal(actual, 0)
+            assert_equal(actual.dtype, np.int64)
+
+    @pytest.mark.parametrize("val1, val2", [
+        # the smallest integer that can't be represented
+        # exactly in a double should be preserved if we avoid
+        # casting to double in floordiv operation
+        (9007199254740993, 1),
+        # stress the alternate floordiv code path where
+        # operand signs don't match and remainder isn't 0
+        (9007199254740999, -2),
+        ])
+    def test_timedelta_floor_div_precision(self, val1, val2):
+        op1 = np.timedelta64(val1)
+        op2 = np.timedelta64(val2)
+        actual = op1 // op2
+        # Python reference integer floor
+        expected = val1 // val2
+        assert_equal(actual, expected)
+
+    @pytest.mark.parametrize("val1, val2", [
+        # years and months sometimes can't be unambiguously
+        # divided for floor division operation
+        (np.timedelta64(7, 'Y'),
+         np.timedelta64(3, 's')),
+        (np.timedelta64(7, 'M'),
+         np.timedelta64(1, 'D')),
+        ])
+    def test_timedelta_floor_div_error(self, val1, val2):
+        with assert_raises_regex(TypeError, "common metadata divisor"):
+            val1 // val2
+
+    @pytest.mark.parametrize("op1, op2", [
+        # reuse the test cases from floordiv
+        (np.timedelta64(7, 's'),
+         np.timedelta64(4, 's')),
+        # m8 same units round down with negative
+        (np.timedelta64(7, 's'),
+         np.timedelta64(-4, 's')),
+        # m8 same units negative no round down
+        (np.timedelta64(8, 's'),
+         np.timedelta64(-4, 's')),
+        # m8 different units
+        (np.timedelta64(1, 'm'),
+         np.timedelta64(31, 's')),
+        # m8 generic units
+        (np.timedelta64(1890),
+         np.timedelta64(31)),
+        # Y // M works
+        (np.timedelta64(2, 'Y'),
+         np.timedelta64('13', 'M')),
+        # handle 1D arrays
+        (np.array([1, 2, 3], dtype='m8'),
+         np.array([2], dtype='m8')),
+        ])
+    def test_timedelta_divmod(self, op1, op2):
+        expected = (op1 // op2, op1 % op2)
+        assert_equal(divmod(op1, op2), expected)
+
+    @pytest.mark.parametrize("op1, op2", [
+        # reuse cases from floordiv
+        # div by 0
+        (np.timedelta64(10, 'us'),
+         np.timedelta64(0, 'us')),
+        # div with NaT
+        (np.timedelta64('NaT'),
+         np.timedelta64(50, 'us')),
+        # special case for int64 min
+        # in integer floor division
+        (np.timedelta64(np.iinfo(np.int64).min),
+         np.timedelta64(-1)),
+        ])
+    def test_timedelta_divmod_warnings(self, op1, op2):
+        with assert_warns(RuntimeWarning):
+            expected = (op1 // op2, op1 % op2)
+        with assert_warns(RuntimeWarning):
+            actual = divmod(op1, op2)
+        assert_equal(actual, expected)
+
     def test_datetime_divide(self):
         for dta, tda, tdb, tdc, tdd in \
                     [
@@ -1111,8 +1238,6 @@ class TestDateTime(object):
             assert_equal(tda / tdd, 60.0)
             assert_equal(tdd / tda, 1.0 / 60.0)
 
-            # m8 // m8
-            assert_raises(TypeError, np.floor_divide, tda, tdb)
             # int / m8
             assert_raises(TypeError, np.divide, 2, tdb)
             # float / m8
@@ -1680,7 +1805,7 @@ class TestDateTime(object):
     def test_timedelta_modulus_div_by_zero(self):
         with assert_warns(RuntimeWarning):
             actual = np.timedelta64(10, 's') % np.timedelta64(0, 's')
-            assert_equal(actual, np.timedelta64(0, 's'))
+            assert_equal(actual, np.timedelta64('NaT'))
 
     @pytest.mark.parametrize("val1, val2", [
         # cases where one operand is not
diff --git a/numpy/core/tests/test_dtype.py b/numpy/core/tests/test_dtype.py
index c55751e3cf388adbc70d29bfbefc2422d4421c94..8f371197cd7299528ea966c6b64e5b576a307fcd 100644
--- a/numpy/core/tests/test_dtype.py
+++ b/numpy/core/tests/test_dtype.py
@@ -4,10 +4,12 @@ import sys
 import operator
 import pytest
 import ctypes
+import gc
 
 import numpy as np
 from numpy.core._rational_tests import rational
-from numpy.testing import assert_, assert_equal, assert_raises
+from numpy.testing import (
+    assert_, assert_equal, assert_array_equal, assert_raises, HAS_REFCOUNT)
 from numpy.core.numeric import pickle
 
 def assert_dtype_equal(a, b):
@@ -446,6 +448,173 @@ class TestSubarray(object):
         assert_equal(t1.alignment, t2.alignment)
 
 
+def iter_struct_object_dtypes():
+    """
+    Iterates over a few complex dtypes and object pattern which
+    fill the array with a given object (defaults to a singleton).
+
+    Yields
+    ------
+    dtype : dtype
+    pattern : tuple
+        Structured tuple for use with `np.array`.
+    count : int
+        Number of objects stored in the dtype.
+    singleton : object
+        A singleton object. The returned pattern is constructed so that
+        all objects inside the datatype are set to the singleton.
+    """
+    obj = object()
+
+    dt = np.dtype([('b', 'O', (2, 3))])
+    p = ([[obj] * 3] * 2,)
+    yield pytest.param(dt, p, 6, obj, id="<subarray>")
+
+    dt = np.dtype([('a', 'i4'), ('b', 'O', (2, 3))])
+    p = (0, [[obj] * 3] * 2)
+    yield pytest.param(dt, p, 6, obj, id="<subarray in field>")
+
+    dt = np.dtype([('a', 'i4'),
+                   ('b', [('ba', 'O'), ('bb', 'i1')], (2, 3))])
+    p = (0, [[(obj, 0)] * 3] * 2)
+    yield pytest.param(dt, p, 6, obj, id="<structured subarray 1>")
+
+    dt = np.dtype([('a', 'i4'),
+                   ('b', [('ba', 'O'), ('bb', 'O')], (2, 3))])
+    p = (0, [[(obj, obj)] * 3] * 2)
+    yield pytest.param(dt, p, 12, obj, id="<structured subarray 2>")
+
+
+@pytest.mark.skipif(not HAS_REFCOUNT, reason="Python lacks refcounts")
+class TestStructuredObjectRefcounting:
+    """These tests cover various uses of complicated structured types which
+    include objects and thus require reference counting.
+    """
+    @pytest.mark.parametrize(['dt', 'pat', 'count', 'singleton'],
+                             iter_struct_object_dtypes())
+    @pytest.mark.parametrize(["creation_func", "creation_obj"], [
+        pytest.param(np.empty, None,
+             # None is probably used for too many things
+             marks=pytest.mark.skip("unreliable due to python's behaviour")),
+        (np.ones, 1),
+        (np.zeros, 0)])
+    def test_structured_object_create_delete(self, dt, pat, count, singleton,
+                                             creation_func, creation_obj):
+        """Structured object reference counting in creation and deletion"""
+        # The test assumes that 0, 1, and None are singletons.
+        gc.collect()
+        before = sys.getrefcount(creation_obj)
+        arr = creation_func(3, dt)
+
+        now = sys.getrefcount(creation_obj)
+        assert now - before == count * 3
+        del arr
+        now = sys.getrefcount(creation_obj)
+        assert now == before
+
+    @pytest.mark.parametrize(['dt', 'pat', 'count', 'singleton'],
+                             iter_struct_object_dtypes())
+    def test_structured_object_item_setting(self, dt, pat, count, singleton):
+        """Structured object reference counting for simple item setting"""
+        one = 1
+
+        gc.collect()
+        before = sys.getrefcount(singleton)
+        arr = np.array([pat] * 3, dt)
+        assert sys.getrefcount(singleton) - before == count * 3
+        # Fill with `1` and check that it was replaced correctly:
+        before2 = sys.getrefcount(one)
+        arr[...] = one
+        after2 = sys.getrefcount(one)
+        assert after2 - before2 == count * 3
+        del arr
+        gc.collect()
+        assert sys.getrefcount(one) == before2
+        assert sys.getrefcount(singleton) == before
+
+    @pytest.mark.parametrize(['dt', 'pat', 'count', 'singleton'],
+                             iter_struct_object_dtypes())
+    @pytest.mark.parametrize(
+        ['shape', 'index', 'items_changed'],
+        [((3,), ([0, 2],), 2),
+         ((3, 2), ([0, 2], slice(None)), 4),
+         ((3, 2), ([0, 2], [1]), 2),
+         ((3,), ([True, False, True]), 2)])
+    def test_structured_object_indexing(self, shape, index, items_changed,
+                                        dt, pat, count, singleton):
+        """Structured object reference counting for advanced indexing."""
+        zero = 0
+        one = 1
+
+        arr = np.zeros(shape, dt)
+
+        gc.collect()
+        before_zero = sys.getrefcount(zero)
+        before_one = sys.getrefcount(one)
+        # Test item getting:
+        part = arr[index]
+        after_zero = sys.getrefcount(zero)
+        assert after_zero - before_zero == count * items_changed
+        del part
+        # Test item setting:
+        arr[index] = one
+        gc.collect()
+        after_zero = sys.getrefcount(zero)
+        after_one = sys.getrefcount(one)
+        assert before_zero - after_zero == count * items_changed
+        assert after_one - before_one == count * items_changed
+
+    @pytest.mark.parametrize(['dt', 'pat', 'count', 'singleton'],
+                             iter_struct_object_dtypes())
+    def test_structured_object_take_and_repeat(self, dt, pat, count, singleton):
+        """Structured object reference counting for specialized functions.
+        The older functions such as take and repeat use different code paths
+        then item setting (when writing this).
+        """
+        indices = [0, 1]
+
+        arr = np.array([pat] * 3, dt)
+        gc.collect()
+        before = sys.getrefcount(singleton)
+        res = arr.take(indices)
+        after = sys.getrefcount(singleton)
+        assert after - before == count * 2
+        new = res.repeat(10)
+        gc.collect()
+        after_repeat = sys.getrefcount(singleton)
+        assert after_repeat - after == count * 2 * 10
+
+
+class TestStructuredDtypeSparseFields(object):
+    """Tests subarray fields which contain sparse dtypes so that
+    not all memory is used by the dtype work. Such dtype's should
+    leave the underlying memory unchanged.
+    """
+    dtype = np.dtype([('a', {'names':['aa', 'ab'], 'formats':['f', 'f'],
+                             'offsets':[0, 4]}, (2, 3))])
+    sparse_dtype = np.dtype([('a', {'names':['ab'], 'formats':['f'],
+                                    'offsets':[4]}, (2, 3))])
+
+    @pytest.mark.xfail(reason="inaccessible data is changed see gh-12686.")
+    @pytest.mark.valgrind_error(reason="reads from unitialized buffers.")
+    def test_sparse_field_assignment(self):
+        arr = np.zeros(3, self.dtype)
+        sparse_arr = arr.view(self.sparse_dtype)
+
+        sparse_arr[...] = np.finfo(np.float32).max
+        # dtype is reduced when accessing the field, so shape is (3, 2, 3):
+        assert_array_equal(arr["a"]["aa"], np.zeros((3, 2, 3)))
+
+    def test_sparse_field_assignment_fancy(self):
+        # Fancy assignment goes to the copyswap function for comlex types:
+        arr = np.zeros(3, self.dtype)
+        sparse_arr = arr.view(self.sparse_dtype)
+
+        sparse_arr[[0, 1, 2]] = np.finfo(np.float32).max
+        # dtype is reduced when accessing the field, so shape is (3, 2, 3):
+        assert_array_equal(arr["a"]["aa"], np.zeros((3, 2, 3)))
+
+
 class TestMonsterType(object):
     """Test deeply nested subtypes."""
 
diff --git a/numpy/core/tests/test_half.py b/numpy/core/tests/test_half.py
index b28c933db956a7ae9411fd94a838a2bab8fa767c..7707125014cff074d5b033244d19d5760975bad8 100644
--- a/numpy/core/tests/test_half.py
+++ b/numpy/core/tests/test_half.py
@@ -69,6 +69,85 @@ class TestHalf(object):
         j = np.array(i_f16, dtype=int)
         assert_equal(i_int, j)
 
+    @pytest.mark.parametrize("offset", [None, "up", "down"])
+    @pytest.mark.parametrize("shift", [None, "up", "down"])
+    @pytest.mark.parametrize("float_t", [np.float32, np.float64])
+    def test_half_conversion_rounding(self, float_t, shift, offset):
+        # Assumes that round to even is used during casting.
+        max_pattern = np.float16(np.finfo(np.float16).max).view(np.uint16)
+
+        # Test all (positive) finite numbers, denormals are most interesting
+        # however:
+        f16s_patterns = np.arange(0, max_pattern+1, dtype=np.uint16)
+        f16s_float = f16s_patterns.view(np.float16).astype(float_t)
+
+        # Shift the values by half a bit up or a down (or do not shift),
+        if shift == "up":
+            f16s_float = 0.5 * (f16s_float[:-1] + f16s_float[1:])[1:]
+        elif shift == "down":
+            f16s_float = 0.5 * (f16s_float[:-1] + f16s_float[1:])[:-1]
+        else:
+            f16s_float = f16s_float[1:-1]
+
+        # Increase the float by a minimal value:
+        if offset == "up":
+            f16s_float = np.nextafter(f16s_float, float_t(1e50))
+        elif offset == "down":
+            f16s_float = np.nextafter(f16s_float, float_t(-1e50))
+
+        # Convert back to float16 and its bit pattern:
+        res_patterns = f16s_float.astype(np.float16).view(np.uint16)
+
+        # The above calculations tries the original values, or the exact
+        # mid points between the float16 values. It then further offsets them
+        # by as little as possible. If no offset occurs, "round to even"
+        # logic will be necessary, an arbitrarily small offset should cause
+        # normal up/down rounding always.
+
+        # Calculate the expecte pattern:
+        cmp_patterns = f16s_patterns[1:-1].copy()
+
+        if shift == "down" and offset != "up":
+            shift_pattern = -1
+        elif shift == "up" and offset != "down":
+            shift_pattern = 1
+        else:
+            # There cannot be a shift, either shift is None, so all rounding
+            # will go back to original, or shift is reduced by offset too much.
+            shift_pattern = 0
+
+        # If rounding occurs, is it normal rounding or round to even?
+        if offset is None:
+            # Round to even occurs, modify only non-even, cast to allow + (-1)
+            cmp_patterns[0::2].view(np.int16)[...] += shift_pattern
+        else:
+            cmp_patterns.view(np.int16)[...] += shift_pattern
+
+        assert_equal(res_patterns, cmp_patterns)
+
+    @pytest.mark.parametrize(["float_t", "uint_t", "bits"],
+                             [(np.float32, np.uint32, 23),
+                              (np.float64, np.uint64, 52)])
+    def test_half_conversion_denormal_round_even(self, float_t, uint_t, bits):
+        # Test specifically that all bits are considered when deciding
+        # whether round to even should occur (i.e. no bits are lost at the
+        # end. Compare also gh-12721. The most bits can get lost for the
+        # smallest denormal:
+        smallest_value = np.uint16(1).view(np.float16).astype(float_t)
+        assert smallest_value == 2**-24
+
+        # Will be rounded to zero based on round to even rule:
+        rounded_to_zero = smallest_value / float_t(2)
+        assert rounded_to_zero.astype(np.float16) == 0
+
+        # The significand will be all 0 for the float_t, test that we do not
+        # lose the lower ones of these:
+        for i in range(bits):
+            # slightly increasing the value should make it round up:
+            larger_pattern = rounded_to_zero.view(uint_t) | uint_t(1 << i)
+            larger_value = larger_pattern.view(float_t)
+            assert larger_value.astype(np.float16) == smallest_value
+
     def test_nans_infs(self):
         with np.errstate(all='ignore'):
             # Check some of the ufuncs
diff --git a/numpy/core/tests/test_multiarray.py b/numpy/core/tests/test_multiarray.py
index 06cabe2cbf22049ac4678ad38a29459b0d3acf01..8a196308cc628279a95bd670294dee6b909f21e9 100644
--- a/numpy/core/tests/test_multiarray.py
+++ b/numpy/core/tests/test_multiarray.py
@@ -3769,10 +3769,16 @@ class TestPickling(object):
                                                    ('c', float)])
             ]
 
+            refs = [weakref.ref(a) for a in DATA]
             for a in DATA:
                 assert_equal(
                         a, pickle.loads(pickle.dumps(a, protocol=proto)),
                         err_msg="%r" % a)
+            del a, DATA, carray
+            gc.collect()
+            # check for reference leaks (gh-12793)
+            for ref in refs:
+                assert ref() is None
 
     def _loads(self, obj):
         if sys.version_info[0] >= 3:
@@ -7009,12 +7015,11 @@ class TestArrayAttributeDeletion(object):
             assert_raises(AttributeError, delattr, a, s)
 
 
-def test_array_interface():
-    # Test scalar coercion within the array interface
+class TestArrayInterface():
     class Foo(object):
         def __init__(self, value):
             self.value = value
-            self.iface = {'typestr': '=f8'}
+            self.iface = {'typestr': 'f8'}
 
         def __float__(self):
             return float(self.value)
@@ -7023,22 +7028,39 @@ def test_array_interface():
         def __array_interface__(self):
             return self.iface
 
+
     f = Foo(0.5)
-    assert_equal(np.array(f), 0.5)
-    assert_equal(np.array([f]), [0.5])
-    assert_equal(np.array([f, f]), [0.5, 0.5])
-    assert_equal(np.array(f).dtype, np.dtype('=f8'))
-    # Test various shape definitions
-    f.iface['shape'] = ()
-    assert_equal(np.array(f), 0.5)
-    f.iface['shape'] = None
-    assert_raises(TypeError, np.array, f)
-    f.iface['shape'] = (1, 1)
-    assert_equal(np.array(f), [[0.5]])
-    f.iface['shape'] = (2,)
-    assert_raises(ValueError, np.array, f)
-
-    # test scalar with no shape
+
+    @pytest.mark.parametrize('val, iface, expected', [
+        (f, {}, 0.5),
+        ([f], {}, [0.5]),
+        ([f, f], {}, [0.5, 0.5]),
+        (f, {'shape': ()}, 0.5),
+        (f, {'shape': None}, TypeError),
+        (f, {'shape': (1, 1)}, [[0.5]]),
+        (f, {'shape': (2,)}, ValueError),
+        (f, {'strides': ()}, 0.5),
+        (f, {'strides': (2,)}, ValueError),
+        (f, {'strides': 16}, TypeError),
+        ])
+    def test_scalar_interface(self, val, iface, expected):
+        # Test scalar coercion within the array interface
+        self.f.iface = {'typestr': 'f8'}
+        self.f.iface.update(iface)
+        if HAS_REFCOUNT:
+            pre_cnt = sys.getrefcount(np.dtype('f8'))
+        if isinstance(expected, type):
+            assert_raises(expected, np.array, val)
+        else:
+            result = np.array(val)
+            assert_equal(np.array(val), expected)
+            assert result.dtype == 'f8'
+            del result
+        if HAS_REFCOUNT:
+            post_cnt = sys.getrefcount(np.dtype('f8'))
+            assert_equal(pre_cnt, post_cnt)
+
+def test_interface_no_shape():
     class ArrayLike(object):
         array = np.array(1)
         __array_interface__ = array.__array_interface__
@@ -7211,6 +7233,7 @@ class TestConversion(object):
         except NameError:
             Error = RuntimeError  # python < 3.5
         assert_raises(Error, bool, self_containing)  # previously stack overflow
+        self_containing[0] = None  # resolve circular reference
 
     def test_to_int_scalar(self):
         # gh-9972 means that these aren't always the same
@@ -7712,6 +7735,8 @@ class TestWritebackIfCopy(object):
         # uses arr_insert
         np.place(a, a>2, [44, 55])
         assert_equal(a, np.array([[0, 44], [1, 55], [2, 44]]))
+        # hit one of the failing paths
+        assert_raises(ValueError, np.place, a, a>20, [])
 
     def test_put_noncontiguous(self):
         a = np.arange(6).reshape(2,3).T # force non-c-contiguous
@@ -8068,3 +8093,43 @@ def test_getfield():
     pytest.raises(ValueError, a.getfield, 'uint8', -1)
     pytest.raises(ValueError, a.getfield, 'uint8', 16)
     pytest.raises(ValueError, a.getfield, 'uint64', 0)
+
+def test_multiarray_module():
+    # gh-12736
+    # numpy 1.16 replaced the multiarray and umath c-extension modules with
+    # a single _multiarray_umath one. For backward compatibility, it added a
+    # pure-python multiarray.py and umath.py shim so people can still do
+    # from numpy.core.multirarray import something-public-api
+    # It turns out pip can leave old pieces of previous versions of numpy
+    # around when installing a newer version. If the old c-extension modules
+    # are found, they will be given precedence over the new pure-python ones.
+    #
+    # This test copies a multiarray c-extension in parallel with the pure-
+    # python one, and starts another python interpreter to load multiarray.
+    # The expectation is that import will fail.
+    import subprocess, shutil
+    core_dir = os.path.dirname(np.core.multiarray.__file__)
+    cextension = np.core._multiarray_umath.__file__
+    testfile = cextension.replace('_multiarray_umath', '_multiarray_module_test')
+    badfile = cextension.replace('_multiarray_umath', 'multiarray')
+    assert not os.path.exists(badfile), '%s exists, this numpy ' \
+                                    'installation is faulty' % badfile
+    try:
+        shutil.copy(testfile, badfile)
+        p = subprocess.Popen([sys.executable, '-c', 'import numpy' ],
+                stdout=subprocess.PIPE, stderr=subprocess.PIPE,
+                env=os.environ.copy())
+        stdout, stderr = p.communicate()
+        r = p.wait()
+        #print(stdout.decode())
+        #print(stderr.decode())
+        assert r != 0
+        assert b'ImportError' in stderr
+    finally:
+        if os.path.exists(badfile):
+            try:
+                # can this fail?
+                os.remove(badfile)
+            except:
+                print("Could not remove %s, remove it by hand" % badfile)
+                raise
diff --git a/numpy/core/tests/test_overrides.py b/numpy/core/tests/test_overrides.py
index 62b2a3e5380be466a5c1ca315559f9c083bada97..8f1c16539bacffd61196aa6f4d413957f9eba150 100644
--- a/numpy/core/tests/test_overrides.py
+++ b/numpy/core/tests/test_overrides.py
@@ -7,7 +7,7 @@ import numpy as np
 from numpy.testing import (
     assert_, assert_equal, assert_raises, assert_raises_regex)
 from numpy.core.overrides import (
-    get_overloaded_types_and_args, array_function_dispatch,
+    _get_implementing_args, array_function_dispatch,
     verify_matching_signatures, ENABLE_ARRAY_FUNCTION)
 from numpy.core.numeric import pickle
 import pytest
@@ -18,11 +18,6 @@ requires_array_function = pytest.mark.skipif(
     reason="__array_function__ dispatch not enabled.")
 
 
-def _get_overloaded_args(relevant_args):
-    types, args = get_overloaded_types_and_args(relevant_args)
-    return args
-
-
 def _return_not_implemented(self, *args, **kwargs):
     return NotImplemented
 
@@ -41,26 +36,21 @@ def dispatched_two_arg(array1, array2):
 
 
 @requires_array_function
-class TestGetOverloadedTypesAndArgs(object):
+class TestGetImplementingArgs(object):
 
     def test_ndarray(self):
         array = np.array(1)
 
-        types, args = get_overloaded_types_and_args([array])
-        assert_equal(set(types), {np.ndarray})
+        args = _get_implementing_args([array])
         assert_equal(list(args), [array])
 
-        types, args = get_overloaded_types_and_args([array, array])
-        assert_equal(len(types), 1)
-        assert_equal(set(types), {np.ndarray})
+        args = _get_implementing_args([array, array])
         assert_equal(list(args), [array])
 
-        types, args = get_overloaded_types_and_args([array, 1])
-        assert_equal(set(types), {np.ndarray})
+        args = _get_implementing_args([array, 1])
         assert_equal(list(args), [array])
 
-        types, args = get_overloaded_types_and_args([1, array])
-        assert_equal(set(types), {np.ndarray})
+        args = _get_implementing_args([1, array])
         assert_equal(list(args), [array])
 
     def test_ndarray_subclasses(self):
@@ -75,17 +65,14 @@ class TestGetOverloadedTypesAndArgs(object):
         override_sub = np.array(1).view(OverrideSub)
         no_override_sub = np.array(1).view(NoOverrideSub)
 
-        types, args = get_overloaded_types_and_args([array, override_sub])
-        assert_equal(set(types), {np.ndarray, OverrideSub})
+        args = _get_implementing_args([array, override_sub])
         assert_equal(list(args), [override_sub, array])
 
-        types, args = get_overloaded_types_and_args([array, no_override_sub])
-        assert_equal(set(types), {np.ndarray, NoOverrideSub})
+        args = _get_implementing_args([array, no_override_sub])
         assert_equal(list(args), [no_override_sub, array])
 
-        types, args = get_overloaded_types_and_args(
+        args = _get_implementing_args(
             [override_sub, no_override_sub])
-        assert_equal(set(types), {OverrideSub, NoOverrideSub})
         assert_equal(list(args), [override_sub, no_override_sub])
 
     def test_ndarray_and_duck_array(self):
@@ -96,12 +83,10 @@ class TestGetOverloadedTypesAndArgs(object):
         array = np.array(1)
         other = Other()
 
-        types, args = get_overloaded_types_and_args([other, array])
-        assert_equal(set(types), {np.ndarray, Other})
+        args = _get_implementing_args([other, array])
         assert_equal(list(args), [other, array])
 
-        types, args = get_overloaded_types_and_args([array, other])
-        assert_equal(set(types), {np.ndarray, Other})
+        args = _get_implementing_args([array, other])
         assert_equal(list(args), [array, other])
 
     def test_ndarray_subclass_and_duck_array(self):
@@ -116,9 +101,9 @@ class TestGetOverloadedTypesAndArgs(object):
         subarray = np.array(1).view(OverrideSub)
         other = Other()
 
-        assert_equal(_get_overloaded_args([array, subarray, other]),
+        assert_equal(_get_implementing_args([array, subarray, other]),
                      [subarray, array, other])
-        assert_equal(_get_overloaded_args([array, other, subarray]),
+        assert_equal(_get_implementing_args([array, other, subarray]),
                      [subarray, array, other])
 
     def test_many_duck_arrays(self):
@@ -140,15 +125,26 @@ class TestGetOverloadedTypesAndArgs(object):
         c = C()
         d = D()
 
-        assert_equal(_get_overloaded_args([1]), [])
-        assert_equal(_get_overloaded_args([a]), [a])
-        assert_equal(_get_overloaded_args([a, 1]), [a])
-        assert_equal(_get_overloaded_args([a, a, a]), [a])
-        assert_equal(_get_overloaded_args([a, d, a]), [a, d])
-        assert_equal(_get_overloaded_args([a, b]), [b, a])
-        assert_equal(_get_overloaded_args([b, a]), [b, a])
-        assert_equal(_get_overloaded_args([a, b, c]), [b, c, a])
-        assert_equal(_get_overloaded_args([a, c, b]), [c, b, a])
+        assert_equal(_get_implementing_args([1]), [])
+        assert_equal(_get_implementing_args([a]), [a])
+        assert_equal(_get_implementing_args([a, 1]), [a])
+        assert_equal(_get_implementing_args([a, a, a]), [a])
+        assert_equal(_get_implementing_args([a, d, a]), [a, d])
+        assert_equal(_get_implementing_args([a, b]), [b, a])
+        assert_equal(_get_implementing_args([b, a]), [b, a])
+        assert_equal(_get_implementing_args([a, b, c]), [b, c, a])
+        assert_equal(_get_implementing_args([a, c, b]), [c, b, a])
+
+    def test_too_many_duck_arrays(self):
+        namespace = dict(__array_function__=_return_not_implemented)
+        types = [type('A' + str(i), (object,), namespace) for i in range(33)]
+        relevant_args = [t() for t in types]
+
+        actual = _get_implementing_args(relevant_args[:32])
+        assert_equal(actual, relevant_args[:32])
+
+        with assert_raises_regex(TypeError, 'distinct argument types'):
+            _get_implementing_args(relevant_args)
 
 
 @requires_array_function
@@ -201,6 +197,14 @@ class TestNDArrayArrayFunction(object):
         result = np.concatenate((array, override_sub))
         assert_equal(result, expected.view(OverrideSub))
 
+    def test_no_wrapper(self):
+        array = np.array(1)
+        func = dispatched_one_arg.__wrapped__
+        with assert_raises_regex(AttributeError, '__wrapped__'):
+            array.__array_function__(func=func,
+                                     types=(np.ndarray,),
+                                     args=(array,), kwargs={})
+
 
 @requires_array_function
 class TestArrayFunctionDispatch(object):
diff --git a/numpy/core/tests/test_regression.py b/numpy/core/tests/test_regression.py
index 2421a11616ad7daaf992e3f6e864f2e402ffe427..472a83696a8f4d201aefeb342c5ba93330c8704d 100644
--- a/numpy/core/tests/test_regression.py
+++ b/numpy/core/tests/test_regression.py
@@ -46,7 +46,7 @@ class TestRegression(object):
             assert_array_equal(a, b)
 
     def test_typeNA(self):
-        # Issue gh-515 
+        # Issue gh-515
         with suppress_warnings() as sup:
             sup.filter(np.VisibleDeprecationWarning)
             assert_equal(np.typeNA[np.int64], 'Int64')
@@ -2411,7 +2411,41 @@ class TestRegression(object):
             if HAS_REFCOUNT:
                 assert_(base <= sys.getrefcount(s))
 
+    @pytest.mark.parametrize('val', [
+        # arrays and scalars
+        np.ones((10, 10), dtype='int32'),
+        np.uint64(10),
+        ])
+    @pytest.mark.parametrize('protocol',
+        range(2, pickle.HIGHEST_PROTOCOL + 1)
+        )
+    def test_pickle_module(self, protocol, val):
+        # gh-12837
+        s = pickle.dumps(val, protocol)
+        assert b'_multiarray_umath' not in s
+        if protocol == 5 and len(val.shape) > 0:
+            # unpickling ndarray goes through _frombuffer for protocol 5
+            assert b'numpy.core.numeric' in s
+        else:
+            assert b'numpy.core.multiarray' in s
+
     def test_object_casting_errors(self):
         # gh-11993
         arr = np.array(['AAAAA', 18465886.0, 18465886.0], dtype=object)
         assert_raises(TypeError, arr.astype, 'c8')
+
+    def test_eff1d_casting(self):
+        # gh-12711
+        x = np.array([1, 2, 4, 7, 0], dtype=np.int16)
+        res = np.ediff1d(x, to_begin=-99, to_end=np.array([88, 99]))
+        assert_equal(res, [-99,   1,   2,   3,  -7,  88,  99])
+        assert_raises(ValueError, np.ediff1d, x, to_begin=(1<<20))
+        assert_raises(ValueError, np.ediff1d, x, to_end=(1<<20))
+
+    def test_pickle_datetime64_array(self):
+        # gh-12745 (would fail with pickle5 installed)
+        d = np.datetime64('2015-07-04 12:59:59.50', 'ns')
+        arr = np.array([d])
+        for proto in range(2, pickle.HIGHEST_PROTOCOL + 1):
+            dumped = pickle.dumps(arr, protocol=proto)
+            assert_equal(pickle.loads(dumped), arr)
diff --git a/numpy/core/tests/test_shape_base.py b/numpy/core/tests/test_shape_base.py
index ef5c118eccf33d4248e56510eb0932949ae56435..b996321c2ee4888ede6972f9bcb48dc895db0f29 100644
--- a/numpy/core/tests/test_shape_base.py
+++ b/numpy/core/tests/test_shape_base.py
@@ -373,6 +373,10 @@ def test_stack():
     # empty arrays
     assert_(stack([[], [], []]).shape == (3, 0))
     assert_(stack([[], [], []], axis=1).shape == (0, 3))
+    # out
+    out = np.zeros_like(r1)
+    np.stack((a, b), out=out)
+    assert_array_equal(out, r1)
     # edge cases
     assert_raises_regex(ValueError, 'need at least one array', stack, [])
     assert_raises_regex(ValueError, 'must have the same shape',
diff --git a/numpy/ctypeslib.py b/numpy/ctypeslib.py
index 9eefbc9f4b7a4368ccf890303ede2510297c1a43..78aa59ddc7ec17b33b3dc641c7594802a2814246 100644
--- a/numpy/ctypeslib.py
+++ b/numpy/ctypeslib.py
@@ -346,27 +346,157 @@ def ndpointer(dtype=None, ndim=None, shape=None, flags=None):
     return klass
 
 
-def _get_typecodes():
-    """ Return a dictionary mapping __array_interface__ formats to ctypes types """
-    ct = ctypes
-    simple_types = [
-        ct.c_byte, ct.c_short, ct.c_int, ct.c_long, ct.c_longlong,
-        ct.c_ubyte, ct.c_ushort, ct.c_uint, ct.c_ulong, ct.c_ulonglong,
-        ct.c_float, ct.c_double,
-    ]
+if ctypes is not None:
+    def _ctype_ndarray(element_type, shape):
+        """ Create an ndarray of the given element type and shape """
+        for dim in shape[::-1]:
+            element_type = dim * element_type
+            # prevent the type name include np.ctypeslib
+            element_type.__module__ = None
+        return element_type
 
-    return {_dtype(ctype).str: ctype for ctype in simple_types}
 
+    def _get_scalar_type_map():
+        """
+        Return a dictionary mapping native endian scalar dtype to ctypes types
+        """
+        ct = ctypes
+        simple_types = [
+            ct.c_byte, ct.c_short, ct.c_int, ct.c_long, ct.c_longlong,
+            ct.c_ubyte, ct.c_ushort, ct.c_uint, ct.c_ulong, ct.c_ulonglong,
+            ct.c_float, ct.c_double,
+            ct.c_bool,
+        ]
+        return {_dtype(ctype): ctype for ctype in simple_types}
 
-def _ctype_ndarray(element_type, shape):
-    """ Create an ndarray of the given element type and shape """
-    for dim in shape[::-1]:
-        element_type = element_type * dim
-    return element_type
 
+    _scalar_type_map = _get_scalar_type_map()
+
+
+    def _ctype_from_dtype_scalar(dtype):
+        # swapping twice ensure that `=` is promoted to <, >, or |
+        dtype_with_endian = dtype.newbyteorder('S').newbyteorder('S')
+        dtype_native = dtype.newbyteorder('=')
+        try:
+            ctype = _scalar_type_map[dtype_native]
+        except KeyError:
+            raise NotImplementedError(
+                "Converting {!r} to a ctypes type".format(dtype)
+            )
+
+        if dtype_with_endian.byteorder == '>':
+            ctype = ctype.__ctype_be__
+        elif dtype_with_endian.byteorder == '<':
+            ctype = ctype.__ctype_le__
+
+        return ctype
+
+
+    def _ctype_from_dtype_subarray(dtype):
+        element_dtype, shape = dtype.subdtype
+        ctype = _ctype_from_dtype(element_dtype)
+        return _ctype_ndarray(ctype, shape)
+
+
+    def _ctype_from_dtype_structured(dtype):
+        # extract offsets of each field
+        field_data = []
+        for name in dtype.names:
+            field_dtype, offset = dtype.fields[name][:2]
+            field_data.append((offset, name, _ctype_from_dtype(field_dtype)))
+
+        # ctypes doesn't care about field order
+        field_data = sorted(field_data, key=lambda f: f[0])
+
+        if len(field_data) > 1 and all(offset == 0 for offset, name, ctype in field_data):
+            # union, if multiple fields all at address 0
+            size = 0
+            _fields_ = []
+            for offset, name, ctype in field_data:
+                _fields_.append((name, ctype))
+                size = max(size, ctypes.sizeof(ctype))
+
+            # pad to the right size
+            if dtype.itemsize != size:
+                _fields_.append(('', ctypes.c_char * dtype.itemsize))
+
+            # we inserted manual padding, so always `_pack_`
+            return type('union', (ctypes.Union,), dict(
+                _fields_=_fields_,
+                _pack_=1,
+                __module__=None,
+            ))
+        else:
+            last_offset = 0
+            _fields_ = []
+            for offset, name, ctype in field_data:
+                padding = offset - last_offset
+                if padding < 0:
+                    raise NotImplementedError("Overlapping fields")
+                if padding > 0:
+                    _fields_.append(('', ctypes.c_char * padding))
+
+                _fields_.append((name, ctype))
+                last_offset = offset + ctypes.sizeof(ctype)
+
+
+            padding = dtype.itemsize - last_offset
+            if padding > 0:
+                _fields_.append(('', ctypes.c_char * padding))
+
+            # we inserted manual padding, so always `_pack_`
+            return type('struct', (ctypes.Structure,), dict(
+                _fields_=_fields_,
+                _pack_=1,
+                __module__=None,
+            ))
+
+
+    def _ctype_from_dtype(dtype):
+        if dtype.fields is not None:
+            return _ctype_from_dtype_structured(dtype)
+        elif dtype.subdtype is not None:
+            return _ctype_from_dtype_subarray(dtype)
+        else:
+            return _ctype_from_dtype_scalar(dtype)
+
+
+    def as_ctypes_type(dtype):
+        """
+        Convert a dtype into a ctypes type.
+
+        Parameters
+        ----------
+        dtype : dtype
+            The dtype to convert
+
+        Returns
+        -------
+        ctypes
+            A ctype scalar, union, array, or struct
+
+        Raises
+        ------
+        NotImplementedError
+            If the conversion is not possible
+
+        Notes
+        -----
+        This function does not losslessly round-trip in either direction.
+
+        ``np.dtype(as_ctypes_type(dt))`` will:
+         - insert padding fields
+         - reorder fields to be sorted by offset
+         - discard field titles
+
+        ``as_ctypes_type(np.dtype(ctype))`` will:
+         - discard the class names of ``Structure``s and ``Union``s
+         - convert single-element ``Union``s into single-element ``Structure``s
+         - insert padding fields
+
+        """
+        return _ctype_from_dtype(_dtype(dtype))
 
-if ctypes is not None:
-    _typecodes = _get_typecodes()
 
     def as_array(obj, shape=None):
         """
@@ -388,6 +518,7 @@ if ctypes is not None:
 
         return array(obj, copy=False)
 
+
     def as_ctypes(obj):
         """Create and return a ctypes object from a numpy array.  Actually
         anything that exposes the __array_interface__ is accepted."""
@@ -399,7 +530,8 @@ if ctypes is not None:
         addr, readonly = ai["data"]
         if readonly:
             raise TypeError("readonly arrays unsupported")
-        tp = _ctype_ndarray(_typecodes[ai["typestr"]], ai["shape"])
-        result = tp.from_address(addr)
+
+        dtype = _dtype((ai["typestr"], ai["shape"]))
+        result = as_ctypes_type(dtype).from_address(addr)
         result.__keep = obj
         return result
diff --git a/numpy/distutils/fcompiler/__init__.py b/numpy/distutils/fcompiler/__init__.py
index 12b32832ea8102c7ebcc6b0b7ebbe33aac8c94e5..001dea5ec609b02b1c56ec260afcc34708da6c25 100644
--- a/numpy/distutils/fcompiler/__init__.py
+++ b/numpy/distutils/fcompiler/__init__.py
@@ -466,10 +466,8 @@ class FCompiler(CCompiler):
         noarch = self.distutils_vars.get('noarch', noopt)
         debug = self.distutils_vars.get('debug', False)
 
-        f77 = shlex.split(self.command_vars.compiler_f77,
-                          posix=(os.name == 'posix'))
-        f90 = shlex.split(self.command_vars.compiler_f90,
-                          posix=(os.name == 'posix'))
+        f77 = self.command_vars.compiler_f77
+        f90 = self.command_vars.compiler_f90
 
         f77flags = []
         f90flags = []
@@ -477,8 +475,10 @@ class FCompiler(CCompiler):
         fixflags = []
 
         if f77:
+            f77 = shlex.split(f77, posix=(os.name == 'posix'))
             f77flags = self.flag_vars.f77
         if f90:
+            f90 = shlex.split(f90, posix=(os.name == 'posix'))
             f90flags = self.flag_vars.f90
             freeflags = self.flag_vars.free
         # XXX Assuming that free format is default for f90 compiler.
@@ -490,8 +490,8 @@ class FCompiler(CCompiler):
         # environment variable has been customized by CI or a user
         # should perhaps eventually be more throughly tested and more
         # robustly handled
-        fix = shlex.split(fix, posix=(os.name == 'posix'))
         if fix:
+            fix = shlex.split(fix, posix=(os.name == 'posix'))
             fixflags = self.flag_vars.fix + f90flags
 
         oflags, aflags, dflags = [], [], []
diff --git a/numpy/distutils/fcompiler/absoft.py b/numpy/distutils/fcompiler/absoft.py
index 2c3edfe023924932e97ecfe75af2d786287b033f..d14fee0e18e3aa8b85987abff2b4404e220c5b84 100644
--- a/numpy/distutils/fcompiler/absoft.py
+++ b/numpy/distutils/fcompiler/absoft.py
@@ -66,7 +66,7 @@ class AbsoftFCompiler(FCompiler):
 
     def library_dir_option(self, dir):
         if os.name=='nt':
-            return ['-link', '/PATH:"%s"' % (dir)]
+            return ['-link', '/PATH:%s' % (dir)]
         return "-L" + dir
 
     def library_option(self, lib):
diff --git a/numpy/distutils/fcompiler/environment.py b/numpy/distutils/fcompiler/environment.py
index 48978458045d8e848d82fb74f25ac7410665b5f4..4238f35cba6a03fe8e171165cc06d791097338ed 100644
--- a/numpy/distutils/fcompiler/environment.py
+++ b/numpy/distutils/fcompiler/environment.py
@@ -1,6 +1,7 @@
 from __future__ import division, absolute_import, print_function
 
 import os
+import warnings
 from distutils.dist import Distribution
 
 __metaclass__ = type
@@ -54,8 +55,18 @@ class EnvironmentConfig(object):
         if envvar is not None:
             envvar_contents = os.environ.get(envvar)
             if envvar_contents is not None:
-                if var and append and os.environ.get('NPY_DISTUTILS_APPEND_FLAGS', '0') == '1':
-                    var = var + [envvar_contents]
+                if var and append:
+                    if os.environ.get('NPY_DISTUTILS_APPEND_FLAGS', '0') == '1':
+                        var = var + [envvar_contents]
+                    else:
+                        var = envvar_contents
+                        if 'NPY_DISTUTILS_APPEND_FLAGS' not in os.environ.keys():
+                            msg = "{} is used as is, not appended ".format(envvar) + \
+                                  "to flags already defined " + \
+                                  "by numpy.distutils! Use NPY_DISTUTILS_APPEND_FLAGS=1 " + \
+                                  "to obtain appending behavior instead (this " + \
+                                  "behavior will become default in a future release)."
+                            warnings.warn(msg, UserWarning, stacklevel=3)
                 else:
                     var = envvar_contents
         if confvar is not None and self._conf:
diff --git a/numpy/distutils/fcompiler/gnu.py b/numpy/distutils/fcompiler/gnu.py
index 81769e562c6a38e510903f2ace80c4eccda628f3..965c67041082b1ff0fdfcaca613c8c315186c1cd 100644
--- a/numpy/distutils/fcompiler/gnu.py
+++ b/numpy/distutils/fcompiler/gnu.py
@@ -269,8 +269,11 @@ class GnuFCompiler(FCompiler):
             # Linux/Solaris/Unix support RPATH, Windows and AIX do not
             raise NotImplementedError
 
+        # TODO: could use -Xlinker here, if it's supported
+        assert "," not in dir
+
         sep = ',' if sys.platform == 'darwin' else '='
-        return '-Wl,-rpath%s"%s"' % (sep, dir)
+        return '-Wl,-rpath%s%s' % (sep, dir)
 
 
 class Gnu95FCompiler(GnuFCompiler):
diff --git a/numpy/distutils/fcompiler/intel.py b/numpy/distutils/fcompiler/intel.py
index 217eac8fbea3d89d595411afc626fed3fd7b930e..51f6812743a28a47232e5d2f0cd4590328c4833a 100644
--- a/numpy/distutils/fcompiler/intel.py
+++ b/numpy/distutils/fcompiler/intel.py
@@ -23,7 +23,10 @@ class BaseIntelFCompiler(FCompiler):
                                            f + '.f', '-o', f + '.o']
 
     def runtime_library_dir_option(self, dir):
-        return '-Wl,-rpath="%s"' % dir
+        # TODO: could use -Xlinker here, if it's supported
+        assert "," not in dir
+
+        return '-Wl,-rpath=%s' % dir
 
 
 class IntelFCompiler(BaseIntelFCompiler):
diff --git a/numpy/distutils/fcompiler/pg.py b/numpy/distutils/fcompiler/pg.py
index 99071800adad3eee0a1eb52a0a387f3ac2890e7d..9c51947fd80335e4a33cbbcf82d4193f885f2629 100644
--- a/numpy/distutils/fcompiler/pg.py
+++ b/numpy/distutils/fcompiler/pg.py
@@ -33,7 +33,7 @@ class PGroupFCompiler(FCompiler):
             'compiler_f77': ["pgfortran"],
             'compiler_fix': ["pgfortran", "-Mfixed"],
             'compiler_f90': ["pgfortran"],
-            'linker_so': ["pgfortran", "-shared", "-fpic"],
+            'linker_so': ["pgfortran"],
             'archiver': ["ar", "-cr"],
             'ranlib': ["ranlib"]
         }
@@ -56,8 +56,12 @@ class PGroupFCompiler(FCompiler):
         def get_flags_linker_so(self):
             return ["-dynamic", '-undefined', 'dynamic_lookup']
 
+    else:
+        def get_flags_linker_so(self):
+            return ["-shared", '-fpic']
+
     def runtime_library_dir_option(self, dir):
-        return '-R"%s"' % dir
+        return '-R%s' % dir
 
 
 if sys.version_info >= (3, 5):
diff --git a/numpy/distutils/fcompiler/sun.py b/numpy/distutils/fcompiler/sun.py
index d477d33087b07d6dbfa0eb5629403634bf4eae5c..561ea854f9826a23cb4004d94e6d233c8c22262e 100644
--- a/numpy/distutils/fcompiler/sun.py
+++ b/numpy/distutils/fcompiler/sun.py
@@ -44,7 +44,7 @@ class SunFCompiler(FCompiler):
         return opt
 
     def runtime_library_dir_option(self, dir):
-        return '-R"%s"' % dir
+        return '-R%s' % dir
 
 if __name__ == '__main__':
     from distutils import log
diff --git a/numpy/distutils/system_info.py b/numpy/distutils/system_info.py
index cd63cc849a373ac161986cabb6aaadac0b84838b..befe53b3dd430f7c3a9c0c9dbbff5692280b9d67 100644
--- a/numpy/distutils/system_info.py
+++ b/numpy/distutils/system_info.py
@@ -164,6 +164,17 @@ _bits = {'32bit': 32, '64bit': 64}
 platform_bits = _bits[platform.architecture()[0]]
 
 
+def _c_string_literal(s):
+    """
+    Convert a python string into a literal suitable for inclusion into C code
+    """
+    # only these three characters are forbidden in C strings
+    s = s.replace('\\', r'\\')
+    s = s.replace('"',  r'\"')
+    s = s.replace('\n', r'\n')
+    return '"{}"'.format(s)
+
+
 def libpaths(paths, bits):
     """Return a list of library paths valid on 32 or 64 bit systems.
 
@@ -1497,7 +1508,7 @@ Make sure that -lgfortran is used for C++ extensions.
             atlas_version = os.environ.get('ATLAS_VERSION', None)
         if atlas_version:
             dict_append(info, define_macros=[(
-                'ATLAS_INFO', '"\\"%s\\""' % atlas_version)
+                'ATLAS_INFO', _c_string_literal(atlas_version))
             ])
         else:
             dict_append(info, define_macros=[('NO_ATLAS_INFO', -1)])
@@ -1518,7 +1529,7 @@ Make sure that -lgfortran is used for C++ extensions.
         dict_append(info, define_macros=[('NO_ATLAS_INFO', -2)])
     else:
         dict_append(info, define_macros=[(
-            'ATLAS_INFO', '"\\"%s\\""' % atlas_version)
+            'ATLAS_INFO', _c_string_literal(atlas_version))
         ])
     result = _cached_atlas_version[key] = atlas_version, info
     return result
@@ -2063,7 +2074,7 @@ class _numpy_info(system_info):
             if vrs is None:
                 continue
             macros = [(self.modulename.upper() + '_VERSION',
-                      '"\\"%s\\""' % (vrs)),
+                      _c_string_literal(vrs)),
                       (self.modulename.upper(), None)]
             break
         dict_append(info, define_macros=macros)
@@ -2268,7 +2279,7 @@ class _pkg_config_info(system_info):
         version = self.get_config_output(config_exe, self.version_flag)
         if version:
             macros.append((self.__class__.__name__.split('.')[-1].upper(),
-                           '"\\"%s\\""' % (version)))
+                           _c_string_literal(version)))
             if self.version_macro_name:
                 macros.append((self.version_macro_name + '_%s'
                                % (version.replace('.', '_')), None))
diff --git a/numpy/distutils/tests/test_fcompiler.py b/numpy/distutils/tests/test_fcompiler.py
index 95e44b051307e82d5aba3dce4698b32cd8ccb1db..ba19a97ea6968d49fc18db2b6841a258152240a1 100644
--- a/numpy/distutils/tests/test_fcompiler.py
+++ b/numpy/distutils/tests/test_fcompiler.py
@@ -1,6 +1,8 @@
 from __future__ import division, absolute_import, print_function
 
-from numpy.testing import assert_
+import pytest
+
+from numpy.testing import assert_, suppress_warnings
 import numpy.distutils.fcompiler
 
 customizable_flags = [
@@ -25,6 +27,7 @@ def test_fcompiler_flags(monkeypatch):
 
         monkeypatch.setenv(envvar, new_flag)
         new_flags = getattr(flag_vars, opt)
+
         monkeypatch.delenv(envvar)
         assert_(new_flags == [new_flag])
 
@@ -33,12 +36,46 @@ def test_fcompiler_flags(monkeypatch):
     for opt, envvar in customizable_flags:
         new_flag = '-dummy-{}-flag'.format(opt)
         prev_flags = getattr(flag_vars, opt)
-
         monkeypatch.setenv(envvar, new_flag)
         new_flags = getattr(flag_vars, opt)
+
         monkeypatch.delenv(envvar)
         if prev_flags is None:
             assert_(new_flags == [new_flag])
         else:
             assert_(new_flags == prev_flags + [new_flag])
 
+
+def test_fcompiler_flags_append_warning(monkeypatch):
+    # Test to check that the warning for append behavior changing in future
+    # is triggered.  Need to use a real compiler instance so that we have
+    # non-empty flags to start with (otherwise the "if var and append" check
+    # will always be false).
+    try:
+        with suppress_warnings() as sup:
+            sup.record()
+            fc = numpy.distutils.fcompiler.new_fcompiler(compiler='gnu95')
+            fc.customize()
+    except numpy.distutils.fcompiler.CompilerNotFound:
+        pytest.skip("gfortran not found, so can't execute this test")
+
+    # Ensure NPY_DISTUTILS_APPEND_FLAGS not defined
+    monkeypatch.delenv('NPY_DISTUTILS_APPEND_FLAGS', raising=False)
+
+    for opt, envvar in customizable_flags:
+        new_flag = '-dummy-{}-flag'.format(opt)
+        with suppress_warnings() as sup:
+            sup.record()
+            prev_flags = getattr(fc.flag_vars, opt)
+
+        monkeypatch.setenv(envvar, new_flag)
+        with suppress_warnings() as sup:
+            sup.record()
+            new_flags = getattr(fc.flag_vars, opt)
+            if prev_flags:
+                # Check that warning was issued
+                assert len(sup.log) == 1
+
+        monkeypatch.delenv(envvar)
+        assert_(new_flags == [new_flag])
+
diff --git a/numpy/f2py/__init__.py b/numpy/f2py/__init__.py
index 23a4b7c41a76be289e8bb594b9ad39501e64ec9d..d146739bb2f1b8c5d3dfbfea25bf719037e77a70 100644
--- a/numpy/f2py/__init__.py
+++ b/numpy/f2py/__init__.py
@@ -28,12 +28,16 @@ def compile(source,
             extension='.f'
            ):
     """
-    Build extension module from processing source with f2py.
+    Build extension module from a Fortran 77 source string with f2py.
 
     Parameters
     ----------
-    source : str
+    source : str or bytes
         Fortran source of module / subroutine to compile
+
+        .. versionchanged:: 1.16.0
+           Accept str as well as bytes
+
     modulename : str, optional
         The name of the compiled python module
     extra_args : str or list, optional
@@ -55,6 +59,16 @@ def compile(source,
 
         .. versionadded:: 1.11.0
 
+    Returns
+    -------
+    result : int
+        0 on success
+
+    Examples
+    --------
+    .. include:: compile_session.dat
+        :literal:
+
     """
     import tempfile
     import shlex
@@ -67,9 +81,11 @@ def compile(source,
     else:
         fname = source_fn
 
+    if not isinstance(source, str):
+        source = str(source, 'utf-8')
     try:
         with open(fname, 'w') as f:
-            f.write(str(source))
+            f.write(source)
 
         args = ['-c', '-m', modulename, f.name]
 
diff --git a/numpy/f2py/f2py2e.py b/numpy/f2py/f2py2e.py
index 8750ed0b3d19e9052733af6e6ba01ad1f4455885..47223151f32fa524a810fda50c176fedf9b78fcd 100755
--- a/numpy/f2py/f2py2e.py
+++ b/numpy/f2py/f2py2e.py
@@ -396,8 +396,25 @@ def dict_append(d_out, d_in):
 
 
 def run_main(comline_list):
-    """Run f2py as if string.join(comline_list,' ') is used as a command line.
-    In case of using -h flag, return None.
+    """
+    Equivalent to running::
+
+        f2py <args>
+
+    where ``<args>=string.join(<list>,' ')``, but in Python.  Unless
+    ``-h`` is used, this function returns a dictionary containing
+    information on generated modules and their dependencies on source
+    files.  For example, the command ``f2py -m scalar scalar.f`` can be
+    executed from Python as follows
+
+    You cannot build extension modules with this function, that is,
+    using ``-c`` is not allowed. Use ``compile`` command instead
+
+    Examples
+    --------
+    .. include:: run_main_session.dat
+        :literal:
+
     """
     crackfortran.reset_global_f2py_vars()
     f2pydir = os.path.dirname(os.path.abspath(cfuncs.__file__))
diff --git a/numpy/f2py/tests/test_compile_function.py b/numpy/f2py/tests/test_compile_function.py
index 74e0804e2144059aa26c2f64991020f62bcb5aa1..36abf05f9cc7a9ec7ec4d17546b8a88e83f29eb7 100644
--- a/numpy/f2py/tests/test_compile_function.py
+++ b/numpy/f2py/tests/test_compile_function.py
@@ -106,3 +106,20 @@ def test_f2py_init_compile_bad_cmd():
         assert_equal(ret_val, 127)
     finally:
         sys.executable = temp
+
+
+@pytest.mark.parametrize('fsource',
+        ['program test_f2py\nend program test_f2py',
+         b'program test_f2py\nend program test_f2py',])
+def test_compile_from_strings(tmpdir, fsource):
+    # Make sure we can compile str and bytes gh-12796
+    cwd = os.getcwd()
+    try:
+        os.chdir(str(tmpdir))
+        ret_val = numpy.f2py.compile(
+                fsource,
+                modulename='test_compile_from_strings',
+                extension='.f90')
+        assert_equal(ret_val, 0)
+    finally:
+        os.chdir(cwd)
diff --git a/numpy/lib/_datasource.py b/numpy/lib/_datasource.py
index 30237b76f9a3e10671dbedcf0aa8d0085825669b..463266e2810697f1f5d87db0ce3bea1a59322f07 100644
--- a/numpy/lib/_datasource.py
+++ b/numpy/lib/_datasource.py
@@ -545,6 +545,11 @@ class DataSource(object):
         is accessible if it exists in either location.
 
         """
+
+        # First test for local path
+        if os.path.exists(path):
+            return True
+
         # We import this here because importing urllib2 is slow and
         # a significant fraction of numpy's total import time.
         if sys.version_info[0] >= 3:
@@ -554,10 +559,6 @@ class DataSource(object):
             from urllib2 import urlopen
             from urllib2 import URLError
 
-        # Test local path
-        if os.path.exists(path):
-            return True
-
         # Test cached url
         upath = self.abspath(path)
         if os.path.exists(upath):
diff --git a/numpy/lib/arraysetops.py b/numpy/lib/arraysetops.py
index fd64ecbd64b130b6253b4ad370bccf39e5849256..3356904ab0254c5aa9661ccd27bbba00891e685d 100644
--- a/numpy/lib/arraysetops.py
+++ b/numpy/lib/arraysetops.py
@@ -94,8 +94,7 @@ def ediff1d(ary, to_end=None, to_begin=None):
     # force a 1d array
     ary = np.asanyarray(ary).ravel()
 
-    # we have unit tests enforcing
-    # propagation of the dtype of input
+    # enforce propagation of the dtype of input
     # ary to returned result
     dtype_req = ary.dtype
 
@@ -106,23 +105,22 @@ def ediff1d(ary, to_end=None, to_begin=None):
     if to_begin is None:
         l_begin = 0
     else:
-        to_begin = np.asanyarray(to_begin)
-        if not np.can_cast(to_begin, dtype_req):
-            raise TypeError("dtype of to_begin must be compatible "
-                            "with input ary")
-
-        to_begin = to_begin.ravel()
+        _to_begin = np.asanyarray(to_begin, dtype=dtype_req)
+        if not np.all(_to_begin == to_begin):
+            raise ValueError("cannot convert 'to_begin' to array with dtype "
+                            "'%r' as required for input ary" % dtype_req)
+        to_begin = _to_begin.ravel()
         l_begin = len(to_begin)
 
     if to_end is None:
         l_end = 0
     else:
-        to_end = np.asanyarray(to_end)
-        if not np.can_cast(to_end, dtype_req):
-            raise TypeError("dtype of to_end must be compatible "
-                            "with input ary")
-
-        to_end = to_end.ravel()
+        _to_end = np.asanyarray(to_end, dtype=dtype_req)
+        # check that casting has not overflowed
+        if not np.all(_to_end == to_end):
+            raise ValueError("cannot convert 'to_end' to array with dtype "
+                             "'%r' as required for input ary" % dtype_req)
+        to_end = _to_end.ravel()
         l_end = len(to_end)
 
     # do the calculation in place and copy to_begin and to_end
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py
index 5f87c8b2c7fa38c484126f4f699c10671c952dac..d9ce3f8a457b3e6489312faa2b65726d0c08c496 100644
--- a/numpy/lib/function_base.py
+++ b/numpy/lib/function_base.py
@@ -2590,6 +2590,7 @@ def blackman(M):
 
     Examples
     --------
+    >>> import matplotlib.pyplot as plt
     >>> np.blackman(12)
     array([ -1.38777878e-17,   3.26064346e-02,   1.59903635e-01,
              4.14397981e-01,   7.36045180e-01,   9.67046769e-01,
@@ -2807,6 +2808,7 @@ def hanning(M):
 
     Plot the window and its frequency response:
 
+    >>> import matplotlib.pyplot as plt
     >>> from numpy.fft import fft, fftshift
     >>> window = np.hanning(51)
     >>> plt.plot(window)
@@ -2906,6 +2908,7 @@ def hamming(M):
 
     Plot the window and the frequency response:
 
+    >>> import matplotlib.pyplot as plt
     >>> from numpy.fft import fft, fftshift
     >>> window = np.hamming(51)
     >>> plt.plot(window)
@@ -3180,6 +3183,7 @@ def kaiser(M, beta):
 
     Examples
     --------
+    >>> import matplotlib.pyplot as plt
     >>> np.kaiser(12, 14)
     array([  7.72686684e-06,   3.46009194e-03,   4.65200189e-02,
              2.29737120e-01,   5.99885316e-01,   9.45674898e-01,
@@ -3273,6 +3277,7 @@ def sinc(x):
 
     Examples
     --------
+    >>> import matplotlib.pyplot as plt
     >>> x = np.linspace(-4, 4, 41)
     >>> np.sinc(x)
     array([ -3.89804309e-17,  -4.92362781e-02,  -8.40918587e-02,
diff --git a/numpy/lib/tests/test_arraysetops.py b/numpy/lib/tests/test_arraysetops.py
index a17fc66e5daf8031344d8aac855ebaf036f0f544..93d4b279f30a74bd4bf206ef0259e0924c8c36e7 100644
--- a/numpy/lib/tests/test_arraysetops.py
+++ b/numpy/lib/tests/test_arraysetops.py
@@ -136,8 +136,8 @@ class TestSetOps(object):
          np.nan),
         # should fail because attempting
         # to downcast to smaller int type:
-        (np.array([1, 2, 3], dtype=np.int32),
-         np.array([5, 7, 2], dtype=np.int64),
+        (np.array([1, 2, 3], dtype=np.int16),
+         np.array([5, 1<<20, 2], dtype=np.int32),
          None),
         # should fail because attempting to cast
         # two special floating point values
@@ -152,8 +152,8 @@ class TestSetOps(object):
         # specifically, raise an appropriate
         # Exception when attempting to append or
         # prepend with an incompatible type
-        msg = 'must be compatible'
-        with assert_raises_regex(TypeError, msg):
+        msg = 'cannot convert'
+        with assert_raises_regex(ValueError, msg):
             ediff1d(ary=ary,
                     to_end=append,
                     to_begin=prepend)
diff --git a/numpy/lib/twodim_base.py b/numpy/lib/twodim_base.py
index 27d84860802322f4c7a3ca1b5ba8189d130cdf93..5c840b1112d1a668056176bb7d56852076ce4f97 100644
--- a/numpy/lib/twodim_base.py
+++ b/numpy/lib/twodim_base.py
@@ -644,7 +644,7 @@ def histogram2d(x, y, bins=10, range=None, normed=None, weights=None,
 
     Examples
     --------
-    >>> import matplotlib as mpl
+    >>> from matplotlib.image import NonUniformImage
     >>> import matplotlib.pyplot as plt
 
     Construct a 2-D histogram with variable bin width. First define the bin
@@ -679,7 +679,7 @@ def histogram2d(x, y, bins=10, range=None, normed=None, weights=None,
 
     >>> ax = fig.add_subplot(133, title='NonUniformImage: interpolated',
     ...         aspect='equal', xlim=xedges[[0, -1]], ylim=yedges[[0, -1]])
-    >>> im = mpl.image.NonUniformImage(ax, interpolation='bilinear')
+    >>> im = NonUniformImage(ax, interpolation='bilinear')
     >>> xcenters = (xedges[:-1] + xedges[1:]) / 2
     >>> ycenters = (yedges[:-1] + yedges[1:]) / 2
     >>> im.set_data(xcenters, ycenters, H)
diff --git a/numpy/random/mtrand/mtrand.c b/numpy/random/mtrand/mtrand.c
index 0d7c3af9f484a79e8b252cfa669477024bc75e90..e8b51d140c2129b42a3a1d3a416dc22cae4817a3 100644
--- a/numpy/random/mtrand/mtrand.c
+++ b/numpy/random/mtrand/mtrand.c
@@ -1815,41 +1815,42 @@ static const char __pyx_k_standard_exponential[] = "standard_exponential";
 static const char __pyx_k_lam_value_too_large_2[] = "lam value too large.";
 static const char __pyx_k_Seed_array_must_be_1_d[] = "Seed array must be 1-d";
 static const char __pyx_k_Seed_must_be_non_empty[] = "Seed must be non-empty";
-static const char __pyx_k_RandomState_f_line_1996[] = "RandomState.f (line 1996)";
+static const char __pyx_k_RandomState_f_line_1999[] = "RandomState.f (line 1999)";
 static const char __pyx_k_a_must_be_1_dimensional[] = "'a' must be 1-dimensional";
 static const char __pyx_k_p_must_be_1_dimensional[] = "'p' must be 1-dimensional";
 static const char __pyx_k_state_must_be_624_longs[] = "state must be 624 longs";
 static const char __pyx_k_algorithm_must_be_MT19937[] = "algorithm must be 'MT19937'";
-static const char __pyx_k_RandomState_rand_line_1320[] = "RandomState.rand (line 1320)";
-static const char __pyx_k_RandomState_wald_line_3515[] = "RandomState.wald (line 3515)";
-static const char __pyx_k_RandomState_zipf_line_3999[] = "RandomState.zipf (line 3999)";
+static const char __pyx_k_probabilities_contain_NaN[] = "probabilities contain NaN";
+static const char __pyx_k_RandomState_rand_line_1323[] = "RandomState.rand (line 1323)";
+static const char __pyx_k_RandomState_wald_line_3522[] = "RandomState.wald (line 3522)";
+static const char __pyx_k_RandomState_zipf_line_4006[] = "RandomState.zipf (line 4006)";
 static const char __pyx_k_Range_exceeds_valid_bounds[] = "Range exceeds valid bounds";
 static const char __pyx_k_low_is_out_of_bounds_for_s[] = "low is out of bounds for %s";
 static const char __pyx_k_mean_must_be_1_dimensional[] = "mean must be 1 dimensional";
 static const char __pyx_k_RandomState_bytes_line_1003[] = "RandomState.bytes (line 1003)";
-static const char __pyx_k_RandomState_gamma_line_1900[] = "RandomState.gamma (line 1900)";
-static const char __pyx_k_RandomState_power_line_2879[] = "RandomState.power (line 2879)";
-static const char __pyx_k_RandomState_randn_line_1364[] = "RandomState.randn (line 1364)";
+static const char __pyx_k_RandomState_gamma_line_1903[] = "RandomState.gamma (line 1903)";
+static const char __pyx_k_RandomState_power_line_2884[] = "RandomState.power (line 2884)";
+static const char __pyx_k_RandomState_randn_line_1367[] = "RandomState.randn (line 1367)";
 static const char __pyx_k_a_and_p_must_have_same_size[] = "'a' and 'p' must have same size";
 static const char __pyx_k_a_must_be_a_valid_float_1_0[] = "'a' must be a valid float > 1.0";
 static const char __pyx_k_high_is_out_of_bounds_for_s[] = "high is out of bounds for %s";
 static const char __pyx_k_RandomState_choice_line_1032[] = "RandomState.choice (line 1032)";
-static const char __pyx_k_RandomState_gumbel_line_3088[] = "RandomState.gumbel (line 3088)";
-static const char __pyx_k_RandomState_normal_line_1551[] = "RandomState.normal (line 1551)";
-static const char __pyx_k_RandomState_pareto_line_2659[] = "RandomState.pareto (line 2659)";
+static const char __pyx_k_RandomState_gumbel_line_3093[] = "RandomState.gumbel (line 3093)";
+static const char __pyx_k_RandomState_normal_line_1554[] = "RandomState.normal (line 1554)";
+static const char __pyx_k_RandomState_pareto_line_2664[] = "RandomState.pareto (line 2664)";
 static const char __pyx_k_RandomState_randint_line_910[] = "RandomState.randint (line 910)";
-static const char __pyx_k_RandomState_laplace_line_2990[] = "RandomState.laplace (line 2990)";
-static const char __pyx_k_RandomState_poisson_line_3911[] = "RandomState.poisson (line 3911)";
-static const char __pyx_k_RandomState_shuffle_line_4777[] = "RandomState.shuffle (line 4777)";
+static const char __pyx_k_RandomState_laplace_line_2995[] = "RandomState.laplace (line 2995)";
+static const char __pyx_k_RandomState_poisson_line_3918[] = "RandomState.poisson (line 3918)";
+static const char __pyx_k_RandomState_shuffle_line_4787[] = "RandomState.shuffle (line 4787)";
 static const char __pyx_k_RandomState_tomaxint_line_863[] = "RandomState.tomaxint (line 863)";
-static const char __pyx_k_RandomState_uniform_line_1214[] = "RandomState.uniform (line 1214)";
-static const char __pyx_k_RandomState_weibull_line_2769[] = "RandomState.weibull (line 2769)";
+static const char __pyx_k_RandomState_uniform_line_1217[] = "RandomState.uniform (line 1217)";
+static const char __pyx_k_RandomState_weibull_line_2774[] = "RandomState.weibull (line 2774)";
 static const char __pyx_k_probabilities_do_not_sum_to_1[] = "probabilities do not sum to 1";
-static const char __pyx_k_RandomState_binomial_line_3696[] = "RandomState.binomial (line 3696)";
-static const char __pyx_k_RandomState_logistic_line_3219[] = "RandomState.logistic (line 3219)";
-static const char __pyx_k_RandomState_rayleigh_line_3436[] = "RandomState.rayleigh (line 3436)";
-static const char __pyx_k_RandomState_vonmises_line_2561[] = "RandomState.vonmises (line 2561)";
-static const char __pyx_k_dirichlet_alpha_size_None_Draw[] = "\n        dirichlet(alpha, size=None)\n\n        Draw samples from the Dirichlet distribution.\n\n        Draw `size` samples of dimension k from a Dirichlet distribution. A\n        Dirichlet-distributed random variable can be seen as a multivariate\n        generalization of a Beta distribution. Dirichlet pdf is the conjugate\n        prior of a multinomial in Bayesian inference.\n\n        Parameters\n        ----------\n        alpha : array\n            Parameter of the distribution (k dimension for sample of\n            dimension k).\n        size : int or tuple of ints, optional\n            Output shape.  If the given shape is, e.g., ``(m, n, k)``, then\n            ``m * n * k`` samples are drawn.  Default is None, in which case a\n            single value is returned.\n\n        Returns\n        -------\n        samples : ndarray,\n            The drawn samples, of shape (size, alpha.ndim).\n\n        Raises\n        -------\n        ValueError\n            If any value in alpha is less than or equal to zero\n\n        Notes\n        -----\n        .. math:: X \\approx \\prod_{i=1}^{k}{x^{\\alpha_i-1}_i}\n\n        Uses the following property for computation: for each dimension,\n        draw a random sample y_i from a standard gamma generator of shape\n        `alpha_i`, then\n        :math:`X = \\frac{1}{\\sum_{i=1}^k{y_i}} (y_1, \\ldots, y_n)` is\n        Dirichlet distributed.\n\n        References\n        ----------\n        .. [1] David McKay, \"Information Theory, Inference and Learning\n               Algorithms,\" chapter 23,\n               http://www.inference.org.uk/mackay/itila/\n        .. [2] Wikipedia, \"Dirichlet distribution\",\n               https://en.wikipedia.org/wiki/Dirichlet_distribution\n\n        Examples\n        --------\n        Taking an example cited in Wikipedia, this distribution can be used if\n        one wanted to cut strings (each of initial length 1.0) into K pieces\n        with different lengths, where each piece"" had, on average, a designated\n        average length, but allowing some variation in the relative sizes of\n        the pieces.\n\n        >>> s = np.random.dirichlet((10, 5, 3), 20).transpose()\n\n        >>> plt.barh(range(20), s[0])\n        >>> plt.barh(range(20), s[1], left=s[0], color='g')\n        >>> plt.barh(range(20), s[2], left=s[0]+s[1], color='r')\n        >>> plt.title(\"Lengths of Strings\")\n\n        ";
+static const char __pyx_k_RandomState_binomial_line_3703[] = "RandomState.binomial (line 3703)";
+static const char __pyx_k_RandomState_logistic_line_3224[] = "RandomState.logistic (line 3224)";
+static const char __pyx_k_RandomState_rayleigh_line_3442[] = "RandomState.rayleigh (line 3442)";
+static const char __pyx_k_RandomState_vonmises_line_2566[] = "RandomState.vonmises (line 2566)";
+static const char __pyx_k_dirichlet_alpha_size_None_Draw[] = "\n        dirichlet(alpha, size=None)\n\n        Draw samples from the Dirichlet distribution.\n\n        Draw `size` samples of dimension k from a Dirichlet distribution. A\n        Dirichlet-distributed random variable can be seen as a multivariate\n        generalization of a Beta distribution. Dirichlet pdf is the conjugate\n        prior of a multinomial in Bayesian inference.\n\n        Parameters\n        ----------\n        alpha : array\n            Parameter of the distribution (k dimension for sample of\n            dimension k).\n        size : int or tuple of ints, optional\n            Output shape.  If the given shape is, e.g., ``(m, n, k)``, then\n            ``m * n * k`` samples are drawn.  Default is None, in which case a\n            single value is returned.\n\n        Returns\n        -------\n        samples : ndarray,\n            The drawn samples, of shape (size, alpha.ndim).\n\n        Raises\n        -------\n        ValueError\n            If any value in alpha is less than or equal to zero\n\n        Notes\n        -----\n        .. math:: X \\approx \\prod_{i=1}^{k}{x^{\\alpha_i-1}_i}\n\n        Uses the following property for computation: for each dimension,\n        draw a random sample y_i from a standard gamma generator of shape\n        `alpha_i`, then\n        :math:`X = \\frac{1}{\\sum_{i=1}^k{y_i}} (y_1, \\ldots, y_n)` is\n        Dirichlet distributed.\n\n        References\n        ----------\n        .. [1] David McKay, \"Information Theory, Inference and Learning\n               Algorithms,\" chapter 23,\n               http://www.inference.org.uk/mackay/itila/\n        .. [2] Wikipedia, \"Dirichlet distribution\",\n               https://en.wikipedia.org/wiki/Dirichlet_distribution\n\n        Examples\n        --------\n        Taking an example cited in Wikipedia, this distribution can be used if\n        one wanted to cut strings (each of initial length 1.0) into K pieces\n        with different lengths, where each piece"" had, on average, a designated\n        average length, but allowing some variation in the relative sizes of\n        the pieces.\n\n        >>> s = np.random.dirichlet((10, 5, 3), 20).transpose()\n\n        >>> import matplotlib.pyplot as plt\n        >>> plt.barh(range(20), s[0])\n        >>> plt.barh(range(20), s[1], left=s[0], color='g')\n        >>> plt.barh(range(20), s[2], left=s[0]+s[1], color='r')\n        >>> plt.title(\"Lengths of Strings\")\n\n        ";
 static const char __pyx_k_laplace_loc_0_0_scale_1_0_size[] = "\n        laplace(loc=0.0, scale=1.0, size=None)\n\n        Draw samples from the Laplace or double exponential distribution with\n        specified location (or mean) and scale (decay).\n\n        The Laplace distribution is similar to the Gaussian/normal distribution,\n        but is sharper at the peak and has fatter tails. It represents the\n        difference between two independent, identically distributed exponential\n        random variables.\n\n        Parameters\n        ----------\n        loc : float or array_like of floats, optional\n            The position, :math:`\\mu`, of the distribution peak. Default is 0.\n        scale : float or array_like of floats, optional\n            :math:`\\lambda`, the exponential decay. Default is 1.\n        size : int or tuple of ints, optional\n            Output shape.  If the given shape is, e.g., ``(m, n, k)``, then\n            ``m * n * k`` samples are drawn.  If size is ``None`` (default),\n            a single value is returned if ``loc`` and ``scale`` are both scalars.\n            Otherwise, ``np.broadcast(loc, scale).size`` samples are drawn.\n\n        Returns\n        -------\n        out : ndarray or scalar\n            Drawn samples from the parameterized Laplace distribution.\n\n        Notes\n        -----\n        It has the probability density function\n\n        .. math:: f(x; \\mu, \\lambda) = \\frac{1}{2\\lambda}\n                                       \\exp\\left(-\\frac{|x - \\mu|}{\\lambda}\\right).\n\n        The first law of Laplace, from 1774, states that the frequency\n        of an error can be expressed as an exponential function of the\n        absolute magnitude of the error, which leads to the Laplace\n        distribution. For many problems in economics and health\n        sciences, this distribution seems to model the data better\n        than the standard Gaussian distribution.\n\n        References\n        ----------\n        .. [1] Abramowitz, M. and Stegun, I. A. (Eds.). \"Han""dbook of\n               Mathematical Functions with Formulas, Graphs, and Mathematical\n               Tables, 9th printing,\" New York: Dover, 1972.\n        .. [2] Kotz, Samuel, et. al. \"The Laplace Distribution and\n               Generalizations, \" Birkhauser, 2001.\n        .. [3] Weisstein, Eric W. \"Laplace Distribution.\"\n               From MathWorld--A Wolfram Web Resource.\n               http://mathworld.wolfram.com/LaplaceDistribution.html\n        .. [4] Wikipedia, \"Laplace distribution\",\n               https://en.wikipedia.org/wiki/Laplace_distribution\n\n        Examples\n        --------\n        Draw samples from the distribution\n\n        >>> loc, scale = 0., 1.\n        >>> s = np.random.laplace(loc, scale, 1000)\n\n        Display the histogram of the samples, along with\n        the probability density function:\n\n        >>> import matplotlib.pyplot as plt\n        >>> count, bins, ignored = plt.hist(s, 30, density=True)\n        >>> x = np.arange(-8., 8., .01)\n        >>> pdf = np.exp(-abs(x-loc)/scale)/(2.*scale)\n        >>> plt.plot(x, pdf)\n\n        Plot Gaussian for comparison:\n\n        >>> g = (1/(scale * np.sqrt(2 * np.pi)) *\n        ...      np.exp(-(x - loc)**2 / (2 * scale**2)))\n        >>> plt.plot(x,g)\n\n        ";
 static const char __pyx_k_permutation_x_Randomly_permute[] = "\n        permutation(x)\n\n        Randomly permute a sequence, or return a permuted range.\n\n        If `x` is a multi-dimensional array, it is only shuffled along its\n        first index.\n\n        Parameters\n        ----------\n        x : int or array_like\n            If `x` is an integer, randomly permute ``np.arange(x)``.\n            If `x` is an array, make a copy and shuffle the elements\n            randomly.\n\n        Returns\n        -------\n        out : ndarray\n            Permuted sequence or array range.\n\n        Examples\n        --------\n        >>> np.random.permutation(10)\n        array([1, 7, 4, 3, 0, 9, 2, 5, 8, 6])\n\n        >>> np.random.permutation([1, 4, 9, 12, 15])\n        array([15,  1,  9,  4, 12])\n\n        >>> arr = np.arange(9).reshape((3, 3))\n        >>> np.random.permutation(arr)\n        array([[6, 7, 8],\n               [0, 1, 2],\n               [3, 4, 5]])\n\n        ";
 static const char __pyx_k_poisson_lam_1_0_size_None_Draw[] = "\n        poisson(lam=1.0, size=None)\n\n        Draw samples from a Poisson distribution.\n\n        The Poisson distribution is the limit of the binomial distribution\n        for large N.\n\n        Parameters\n        ----------\n        lam : float or array_like of floats\n            Expectation of interval, should be >= 0. A sequence of expectation\n            intervals must be broadcastable over the requested size.\n        size : int or tuple of ints, optional\n            Output shape.  If the given shape is, e.g., ``(m, n, k)``, then\n            ``m * n * k`` samples are drawn.  If size is ``None`` (default),\n            a single value is returned if ``lam`` is a scalar. Otherwise,\n            ``np.array(lam).size`` samples are drawn.\n\n        Returns\n        -------\n        out : ndarray or scalar\n            Drawn samples from the parameterized Poisson distribution.\n\n        Notes\n        -----\n        The Poisson distribution\n\n        .. math:: f(k; \\lambda)=\\frac{\\lambda^k e^{-\\lambda}}{k!}\n\n        For events with an expected separation :math:`\\lambda` the Poisson\n        distribution :math:`f(k; \\lambda)` describes the probability of\n        :math:`k` events occurring within the observed\n        interval :math:`\\lambda`.\n\n        Because the output is limited to the range of the C long type, a\n        ValueError is raised when `lam` is within 10 sigma of the maximum\n        representable value.\n\n        References\n        ----------\n        .. [1] Weisstein, Eric W. \"Poisson Distribution.\"\n               From MathWorld--A Wolfram Web Resource.\n               http://mathworld.wolfram.com/PoissonDistribution.html\n        .. [2] Wikipedia, \"Poisson distribution\",\n               https://en.wikipedia.org/wiki/Poisson_distribution\n\n        Examples\n        --------\n        Draw samples from the distribution:\n\n        >>> import numpy as np\n        >>> s = np.random.poisson(5, 10000)\n\n        Display hist""ogram of the sample:\n\n        >>> import matplotlib.pyplot as plt\n        >>> count, bins, ignored = plt.hist(s, 14, density=True)\n        >>> plt.show()\n\n        Draw each 100 values for lambda 100 and 500:\n\n        >>> s = np.random.poisson(lam=(100., 500.), size=(100, 2))\n\n        ";
@@ -1857,19 +1858,19 @@ static const char __pyx_k_rand_d0_d1_dn_Random_values_in[] = "\n        rand(d0,
 static const char __pyx_k_randn_d0_d1_dn_Return_a_sample[] = "\n        randn(d0, d1, ..., dn)\n\n        Return a sample (or samples) from the \"standard normal\" distribution.\n\n        If positive, int_like or int-convertible arguments are provided,\n        `randn` generates an array of shape ``(d0, d1, ..., dn)``, filled\n        with random floats sampled from a univariate \"normal\" (Gaussian)\n        distribution of mean 0 and variance 1 (if any of the :math:`d_i` are\n        floats, they are first converted to integers by truncation). A single\n        float randomly sampled from the distribution is returned if no\n        argument is provided.\n\n        This is a convenience function.  If you want an interface that takes a\n        tuple as the first argument, use `numpy.random.standard_normal` instead.\n\n        Parameters\n        ----------\n        d0, d1, ..., dn : int, optional\n            The dimensions of the returned array, should be all positive.\n            If no argument is given a single Python float is returned.\n\n        Returns\n        -------\n        Z : ndarray or float\n            A ``(d0, d1, ..., dn)``-shaped array of floating-point samples from\n            the standard normal distribution, or a single such float if\n            no parameters were supplied.\n\n        See Also\n        --------\n        standard_normal : Similar, but takes a tuple as its argument.\n\n        Notes\n        -----\n        For random samples from :math:`N(\\mu, \\sigma^2)`, use:\n\n        ``sigma * np.random.randn(...) + mu``\n\n        Examples\n        --------\n        >>> np.random.randn()\n        2.1923875335537315 #random\n\n        Two-by-four array of samples from N(3, 6.25):\n\n        >>> 2.5 * np.random.randn(2, 4) + 3\n        array([[-4.49401501,  4.00950034, -1.81814867,  7.29718677],  #random\n               [ 0.39924804,  4.68456316,  4.99394529,  4.84057254]]) #random\n\n        ";
 static const char __pyx_k_random_sample_size_None_Return[] = "\n        random_sample(size=None)\n\n        Return random floats in the half-open interval [0.0, 1.0).\n\n        Results are from the \"continuous uniform\" distribution over the\n        stated interval.  To sample :math:`Unif[a, b), b > a` multiply\n        the output of `random_sample` by `(b-a)` and add `a`::\n\n          (b - a) * random_sample() + a\n\n        Parameters\n        ----------\n        size : int or tuple of ints, optional\n            Output shape.  If the given shape is, e.g., ``(m, n, k)``, then\n            ``m * n * k`` samples are drawn.  Default is None, in which case a\n            single value is returned.\n\n        Returns\n        -------\n        out : float or ndarray of floats\n            Array of random floats of shape `size` (unless ``size=None``, in which\n            case a single float is returned).\n\n        Examples\n        --------\n        >>> np.random.random_sample()\n        0.47108547995356098\n        >>> type(np.random.random_sample())\n        <type 'float'>\n        >>> np.random.random_sample((5,))\n        array([ 0.30220482,  0.86820401,  0.1654503 ,  0.11659149,  0.54323428])\n\n        Three-by-two array of random numbers from [-5, 0):\n\n        >>> 5 * np.random.random_sample((3, 2)) - 5\n        array([[-3.99149989, -0.52338984],\n               [-2.99091858, -0.79479508],\n               [-1.23204345, -1.75224494]])\n\n        ";
 static const char __pyx_k_shuffle_x_Modify_a_sequence_in[] = "\n        shuffle(x)\n\n        Modify a sequence in-place by shuffling its contents.\n\n        This function only shuffles the array along the first axis of a\n        multi-dimensional array. The order of sub-arrays is changed but\n        their contents remains the same.\n\n        Parameters\n        ----------\n        x : array_like\n            The array or list to be shuffled.\n\n        Returns\n        -------\n        None\n\n        Examples\n        --------\n        >>> arr = np.arange(10)\n        >>> np.random.shuffle(arr)\n        >>> arr\n        [1 7 5 2 9 4 3 6 0 8]\n\n        Multi-dimensional arrays are only shuffled along the first axis:\n\n        >>> arr = np.arange(9).reshape((3, 3))\n        >>> np.random.shuffle(arr)\n        >>> arr\n        array([[3, 4, 5],\n               [6, 7, 8],\n               [0, 1, 2]])\n\n        ";
-static const char __pyx_k_standard_cauchy_size_None_Draw[] = "\n        standard_cauchy(size=None)\n\n        Draw samples from a standard Cauchy distribution with mode = 0.\n\n        Also known as the Lorentz distribution.\n\n        Parameters\n        ----------\n        size : int or tuple of ints, optional\n            Output shape.  If the given shape is, e.g., ``(m, n, k)``, then\n            ``m * n * k`` samples are drawn.  Default is None, in which case a\n            single value is returned.\n\n        Returns\n        -------\n        samples : ndarray or scalar\n            The drawn samples.\n\n        Notes\n        -----\n        The probability density function for the full Cauchy distribution is\n\n        .. math:: P(x; x_0, \\gamma) = \\frac{1}{\\pi \\gamma \\bigl[ 1+\n                  (\\frac{x-x_0}{\\gamma})^2 \\bigr] }\n\n        and the Standard Cauchy distribution just sets :math:`x_0=0` and\n        :math:`\\gamma=1`\n\n        The Cauchy distribution arises in the solution to the driven harmonic\n        oscillator problem, and also describes spectral line broadening. It\n        also describes the distribution of values at which a line tilted at\n        a random angle will cut the x axis.\n\n        When studying hypothesis tests that assume normality, seeing how the\n        tests perform on data from a Cauchy distribution is a good indicator of\n        their sensitivity to a heavy-tailed distribution, since the Cauchy looks\n        very much like a Gaussian distribution, but with heavier tails.\n\n        References\n        ----------\n        .. [1] NIST/SEMATECH e-Handbook of Statistical Methods, \"Cauchy\n              Distribution\",\n              https://www.itl.nist.gov/div898/handbook/eda/section3/eda3663.htm\n        .. [2] Weisstein, Eric W. \"Cauchy Distribution.\" From MathWorld--A\n              Wolfram Web Resource.\n              http://mathworld.wolfram.com/CauchyDistribution.html\n        .. [3] Wikipedia, \"Cauchy distribution\"\n              https://en.wikipedia.org/wiki""/Cauchy_distribution\n\n        Examples\n        --------\n        Draw samples and plot the distribution:\n\n        >>> s = np.random.standard_cauchy(1000000)\n        >>> s = s[(s>-25) & (s<25)]  # truncate distribution so it plots well\n        >>> plt.hist(s, bins=100)\n        >>> plt.show()\n\n        ";
+static const char __pyx_k_standard_cauchy_size_None_Draw[] = "\n        standard_cauchy(size=None)\n\n        Draw samples from a standard Cauchy distribution with mode = 0.\n\n        Also known as the Lorentz distribution.\n\n        Parameters\n        ----------\n        size : int or tuple of ints, optional\n            Output shape.  If the given shape is, e.g., ``(m, n, k)``, then\n            ``m * n * k`` samples are drawn.  Default is None, in which case a\n            single value is returned.\n\n        Returns\n        -------\n        samples : ndarray or scalar\n            The drawn samples.\n\n        Notes\n        -----\n        The probability density function for the full Cauchy distribution is\n\n        .. math:: P(x; x_0, \\gamma) = \\frac{1}{\\pi \\gamma \\bigl[ 1+\n                  (\\frac{x-x_0}{\\gamma})^2 \\bigr] }\n\n        and the Standard Cauchy distribution just sets :math:`x_0=0` and\n        :math:`\\gamma=1`\n\n        The Cauchy distribution arises in the solution to the driven harmonic\n        oscillator problem, and also describes spectral line broadening. It\n        also describes the distribution of values at which a line tilted at\n        a random angle will cut the x axis.\n\n        When studying hypothesis tests that assume normality, seeing how the\n        tests perform on data from a Cauchy distribution is a good indicator of\n        their sensitivity to a heavy-tailed distribution, since the Cauchy looks\n        very much like a Gaussian distribution, but with heavier tails.\n\n        References\n        ----------\n        .. [1] NIST/SEMATECH e-Handbook of Statistical Methods, \"Cauchy\n              Distribution\",\n              https://www.itl.nist.gov/div898/handbook/eda/section3/eda3663.htm\n        .. [2] Weisstein, Eric W. \"Cauchy Distribution.\" From MathWorld--A\n              Wolfram Web Resource.\n              http://mathworld.wolfram.com/CauchyDistribution.html\n        .. [3] Wikipedia, \"Cauchy distribution\"\n              https://en.wikipedia.org/wiki""/Cauchy_distribution\n\n        Examples\n        --------\n        Draw samples and plot the distribution:\n\n        >>> import matplotlib.pyplot as plt\n        >>> s = np.random.standard_cauchy(1000000)\n        >>> s = s[(s>-25) & (s<25)]  # truncate distribution so it plots well\n        >>> plt.hist(s, bins=100)\n        >>> plt.show()\n\n        ";
 static const char __pyx_k_standard_exponential_size_None[] = "\n        standard_exponential(size=None)\n\n        Draw samples from the standard exponential distribution.\n\n        `standard_exponential` is identical to the exponential distribution\n        with a scale parameter of 1.\n\n        Parameters\n        ----------\n        size : int or tuple of ints, optional\n            Output shape.  If the given shape is, e.g., ``(m, n, k)``, then\n            ``m * n * k`` samples are drawn.  Default is None, in which case a\n            single value is returned.\n\n        Returns\n        -------\n        out : float or ndarray\n            Drawn samples.\n\n        Examples\n        --------\n        Output a 3x8000 array:\n\n        >>> n = np.random.standard_exponential((3, 8000))\n\n        ";
 static const char __pyx_k_standard_gamma_shape_size_None[] = "\n        standard_gamma(shape, size=None)\n\n        Draw samples from a standard Gamma distribution.\n\n        Samples are drawn from a Gamma distribution with specified parameters,\n        shape (sometimes designated \"k\") and scale=1.\n\n        Parameters\n        ----------\n        shape : float or array_like of floats\n            Parameter, should be > 0.\n        size : int or tuple of ints, optional\n            Output shape.  If the given shape is, e.g., ``(m, n, k)``, then\n            ``m * n * k`` samples are drawn.  If size is ``None`` (default),\n            a single value is returned if ``shape`` is a scalar.  Otherwise,\n            ``np.array(shape).size`` samples are drawn.\n\n        Returns\n        -------\n        out : ndarray or scalar\n            Drawn samples from the parameterized standard gamma distribution.\n\n        See Also\n        --------\n        scipy.stats.gamma : probability density function, distribution or\n            cumulative density function, etc.\n\n        Notes\n        -----\n        The probability density for the Gamma distribution is\n\n        .. math:: p(x) = x^{k-1}\\frac{e^{-x/\\theta}}{\\theta^k\\Gamma(k)},\n\n        where :math:`k` is the shape and :math:`\\theta` the scale,\n        and :math:`\\Gamma` is the Gamma function.\n\n        The Gamma distribution is often used to model the times to failure of\n        electronic components, and arises naturally in processes for which the\n        waiting times between Poisson distributed events are relevant.\n\n        References\n        ----------\n        .. [1] Weisstein, Eric W. \"Gamma Distribution.\" From MathWorld--A\n               Wolfram Web Resource.\n               http://mathworld.wolfram.com/GammaDistribution.html\n        .. [2] Wikipedia, \"Gamma distribution\",\n               https://en.wikipedia.org/wiki/Gamma_distribution\n\n        Examples\n        --------\n        Draw samples from the distribution:\n\n        >>> shape, scale = ""2., 1. # mean and width\n        >>> s = np.random.standard_gamma(shape, 1000000)\n\n        Display the histogram of the samples, along with\n        the probability density function:\n\n        >>> import matplotlib.pyplot as plt\n        >>> import scipy.special as sps\n        >>> count, bins, ignored = plt.hist(s, 50, density=True)\n        >>> y = bins**(shape-1) * ((np.exp(-bins/scale))/ \\\n        ...                       (sps.gamma(shape) * scale**shape))\n        >>> plt.plot(bins, y, linewidth=2, color='r')\n        >>> plt.show()\n\n        ";
 static const char __pyx_k_standard_normal_size_None_Draw[] = "\n        standard_normal(size=None)\n\n        Draw samples from a standard Normal distribution (mean=0, stdev=1).\n\n        Parameters\n        ----------\n        size : int or tuple of ints, optional\n            Output shape.  If the given shape is, e.g., ``(m, n, k)``, then\n            ``m * n * k`` samples are drawn.  Default is None, in which case a\n            single value is returned.\n\n        Returns\n        -------\n        out : float or ndarray\n            Drawn samples.\n\n        Examples\n        --------\n        >>> s = np.random.standard_normal(8000)\n        >>> s\n        array([ 0.6888893 ,  0.78096262, -0.89086505, ...,  0.49876311, #random\n               -0.38672696, -0.4685006 ])                               #random\n        >>> s.shape\n        (8000,)\n        >>> s = np.random.standard_normal(size=(3, 4, 2))\n        >>> s.shape\n        (3, 4, 2)\n\n        ";
 static const char __pyx_k_wald_mean_scale_size_None_Draw[] = "\n        wald(mean, scale, size=None)\n\n        Draw samples from a Wald, or inverse Gaussian, distribution.\n\n        As the scale approaches infinity, the distribution becomes more like a\n        Gaussian. Some references claim that the Wald is an inverse Gaussian\n        with mean equal to 1, but this is by no means universal.\n\n        The inverse Gaussian distribution was first studied in relationship to\n        Brownian motion. In 1956 M.C.K. Tweedie used the name inverse Gaussian\n        because there is an inverse relationship between the time to cover a\n        unit distance and distance covered in unit time.\n\n        Parameters\n        ----------\n        mean : float or array_like of floats\n            Distribution mean, should be > 0.\n        scale : float or array_like of floats\n            Scale parameter, should be >= 0.\n        size : int or tuple of ints, optional\n            Output shape.  If the given shape is, e.g., ``(m, n, k)``, then\n            ``m * n * k`` samples are drawn.  If size is ``None`` (default),\n            a single value is returned if ``mean`` and ``scale`` are both scalars.\n            Otherwise, ``np.broadcast(mean, scale).size`` samples are drawn.\n\n        Returns\n        -------\n        out : ndarray or scalar\n            Drawn samples from the parameterized Wald distribution.\n\n        Notes\n        -----\n        The probability density function for the Wald distribution is\n\n        .. math:: P(x;mean,scale) = \\sqrt{\\frac{scale}{2\\pi x^3}}e^\n                                    \\frac{-scale(x-mean)^2}{2\\cdotp mean^2x}\n\n        As noted above the inverse Gaussian distribution first arise\n        from attempts to model Brownian motion. It is also a\n        competitor to the Weibull for use in reliability modeling and\n        modeling stock returns and interest rate processes.\n\n        References\n        ----------\n        .. [1] Brighton Webs Ltd., Wald Distribution,\n              "" https://web.archive.org/web/20090423014010/http://www.brighton-webs.co.uk:80/distributions/wald.asp\n        .. [2] Chhikara, Raj S., and Folks, J. Leroy, \"The Inverse Gaussian\n               Distribution: Theory : Methodology, and Applications\", CRC Press,\n               1988.\n        .. [3] Wikipedia, \"Inverse Gaussian distribution\"\n               https://en.wikipedia.org/wiki/Inverse_Gaussian_distribution\n\n        Examples\n        --------\n        Draw values from the distribution and plot the histogram:\n\n        >>> import matplotlib.pyplot as plt\n        >>> h = plt.hist(np.random.wald(3, 2, 100000), bins=200, density=True)\n        >>> plt.show()\n\n        ";
-static const char __pyx_k_RandomState_chisquare_line_2204[] = "RandomState.chisquare (line 2204)";
-static const char __pyx_k_RandomState_dirichlet_line_4654[] = "RandomState.dirichlet (line 4654)";
-static const char __pyx_k_RandomState_geometric_line_4092[] = "RandomState.geometric (line 4092)";
-static const char __pyx_k_RandomState_hypergeometric_line[] = "RandomState.hypergeometric (line 4160)";
-static const char __pyx_k_RandomState_lognormal_line_3312[] = "RandomState.lognormal (line 3312)";
-static const char __pyx_k_RandomState_logseries_line_4282[] = "RandomState.logseries (line 4282)";
-static const char __pyx_k_RandomState_multivariate_normal[] = "RandomState.multivariate_normal (line 4379)";
-static const char __pyx_k_RandomState_standard_gamma_line[] = "RandomState.standard_gamma (line 1814)";
+static const char __pyx_k_RandomState_chisquare_line_2208[] = "RandomState.chisquare (line 2208)";
+static const char __pyx_k_RandomState_dirichlet_line_4663[] = "RandomState.dirichlet (line 4663)";
+static const char __pyx_k_RandomState_geometric_line_4099[] = "RandomState.geometric (line 4099)";
+static const char __pyx_k_RandomState_hypergeometric_line[] = "RandomState.hypergeometric (line 4167)";
+static const char __pyx_k_RandomState_lognormal_line_3318[] = "RandomState.lognormal (line 3318)";
+static const char __pyx_k_RandomState_logseries_line_4290[] = "RandomState.logseries (line 4290)";
+static const char __pyx_k_RandomState_multivariate_normal[] = "RandomState.multivariate_normal (line 4388)";
+static const char __pyx_k_RandomState_standard_gamma_line[] = "RandomState.standard_gamma (line 1817)";
 static const char __pyx_k_Seed_must_be_between_0_and_2_32[] = "Seed must be between 0 and 2**32 - 1";
 static const char __pyx_k_Unsupported_dtype_s_for_randint[] = "Unsupported dtype \"%s\" for randint";
 static const char __pyx_k_a_cannot_be_empty_unless_no_sam[] = "'a' cannot be empty unless no samples are taken";
@@ -1884,22 +1885,22 @@ static const char __pyx_k_f_dfnum_dfden_size_None_Draw_sa[] = "\n        f(dfnum
 static const char __pyx_k_gamma_shape_scale_1_0_size_None[] = "\n        gamma(shape, scale=1.0, size=None)\n\n        Draw samples from a Gamma distribution.\n\n        Samples are drawn from a Gamma distribution with specified parameters,\n        `shape` (sometimes designated \"k\") and `scale` (sometimes designated\n        \"theta\"), where both parameters are > 0.\n\n        Parameters\n        ----------\n        shape : float or array_like of floats\n            The shape of the gamma distribution. Should be greater than zero.\n        scale : float or array_like of floats, optional\n            The scale of the gamma distribution. Should be greater than zero.\n            Default is equal to 1.\n        size : int or tuple of ints, optional\n            Output shape.  If the given shape is, e.g., ``(m, n, k)``, then\n            ``m * n * k`` samples are drawn.  If size is ``None`` (default),\n            a single value is returned if ``shape`` and ``scale`` are both scalars.\n            Otherwise, ``np.broadcast(shape, scale).size`` samples are drawn.\n\n        Returns\n        -------\n        out : ndarray or scalar\n            Drawn samples from the parameterized gamma distribution.\n\n        See Also\n        --------\n        scipy.stats.gamma : probability density function, distribution or\n            cumulative density function, etc.\n\n        Notes\n        -----\n        The probability density for the Gamma distribution is\n\n        .. math:: p(x) = x^{k-1}\\frac{e^{-x/\\theta}}{\\theta^k\\Gamma(k)},\n\n        where :math:`k` is the shape and :math:`\\theta` the scale,\n        and :math:`\\Gamma` is the Gamma function.\n\n        The Gamma distribution is often used to model the times to failure of\n        electronic components, and arises naturally in processes for which the\n        waiting times between Poisson distributed events are relevant.\n\n        References\n        ----------\n        .. [1] Weisstein, Eric W. \"Gamma Distribution.\" From MathWorld--A\n               Wolfram Web Resourc""e.\n               http://mathworld.wolfram.com/GammaDistribution.html\n        .. [2] Wikipedia, \"Gamma distribution\",\n               https://en.wikipedia.org/wiki/Gamma_distribution\n\n        Examples\n        --------\n        Draw samples from the distribution:\n\n        >>> shape, scale = 2., 2.  # mean=4, std=2*sqrt(2)\n        >>> s = np.random.gamma(shape, scale, 1000)\n\n        Display the histogram of the samples, along with\n        the probability density function:\n\n        >>> import matplotlib.pyplot as plt\n        >>> import scipy.special as sps\n        >>> count, bins, ignored = plt.hist(s, 50, density=True)\n        >>> y = bins**(shape-1)*(np.exp(-bins/scale) /\n        ...                      (sps.gamma(shape)*scale**shape))\n        >>> plt.plot(bins, y, linewidth=2, color='r')\n        >>> plt.show()\n\n        ";
 static const char __pyx_k_geometric_p_size_None_Draw_samp[] = "\n        geometric(p, size=None)\n\n        Draw samples from the geometric distribution.\n\n        Bernoulli trials are experiments with one of two outcomes:\n        success or failure (an example of such an experiment is flipping\n        a coin).  The geometric distribution models the number of trials\n        that must be run in order to achieve success.  It is therefore\n        supported on the positive integers, ``k = 1, 2, ...``.\n\n        The probability mass function of the geometric distribution is\n\n        .. math:: f(k) = (1 - p)^{k - 1} p\n\n        where `p` is the probability of success of an individual trial.\n\n        Parameters\n        ----------\n        p : float or array_like of floats\n            The probability of success of an individual trial.\n        size : int or tuple of ints, optional\n            Output shape.  If the given shape is, e.g., ``(m, n, k)``, then\n            ``m * n * k`` samples are drawn.  If size is ``None`` (default),\n            a single value is returned if ``p`` is a scalar.  Otherwise,\n            ``np.array(p).size`` samples are drawn.\n\n        Returns\n        -------\n        out : ndarray or scalar\n            Drawn samples from the parameterized geometric distribution.\n\n        Examples\n        --------\n        Draw ten thousand values from the geometric distribution,\n        with the probability of an individual success equal to 0.35:\n\n        >>> z = np.random.geometric(p=0.35, size=10000)\n\n        How many trials succeeded after a single run?\n\n        >>> (z == 1).sum() / 10000.\n        0.34889999999999999 #random\n\n        ";
 static const char __pyx_k_gumbel_loc_0_0_scale_1_0_size_N[] = "\n        gumbel(loc=0.0, scale=1.0, size=None)\n\n        Draw samples from a Gumbel distribution.\n\n        Draw samples from a Gumbel distribution with specified location and\n        scale.  For more information on the Gumbel distribution, see\n        Notes and References below.\n\n        Parameters\n        ----------\n        loc : float or array_like of floats, optional\n            The location of the mode of the distribution. Default is 0.\n        scale : float or array_like of floats, optional\n            The scale parameter of the distribution. Default is 1.\n        size : int or tuple of ints, optional\n            Output shape.  If the given shape is, e.g., ``(m, n, k)``, then\n            ``m * n * k`` samples are drawn.  If size is ``None`` (default),\n            a single value is returned if ``loc`` and ``scale`` are both scalars.\n            Otherwise, ``np.broadcast(loc, scale).size`` samples are drawn.\n\n        Returns\n        -------\n        out : ndarray or scalar\n            Drawn samples from the parameterized Gumbel distribution.\n\n        See Also\n        --------\n        scipy.stats.gumbel_l\n        scipy.stats.gumbel_r\n        scipy.stats.genextreme\n        weibull\n\n        Notes\n        -----\n        The Gumbel (or Smallest Extreme Value (SEV) or the Smallest Extreme\n        Value Type I) distribution is one of a class of Generalized Extreme\n        Value (GEV) distributions used in modeling extreme value problems.\n        The Gumbel is a special case of the Extreme Value Type I distribution\n        for maximums from distributions with \"exponential-like\" tails.\n\n        The probability density for the Gumbel distribution is\n\n        .. math:: p(x) = \\frac{e^{-(x - \\mu)/ \\beta}}{\\beta} e^{ -e^{-(x - \\mu)/\n                  \\beta}},\n\n        where :math:`\\mu` is the mode, a location parameter, and\n        :math:`\\beta` is the scale parameter.\n\n        The Gumbel (named for German mathematician ""Emil Julius Gumbel) was used\n        very early in the hydrology literature, for modeling the occurrence of\n        flood events. It is also used for modeling maximum wind speed and\n        rainfall rates.  It is a \"fat-tailed\" distribution - the probability of\n        an event in the tail of the distribution is larger than if one used a\n        Gaussian, hence the surprisingly frequent occurrence of 100-year\n        floods. Floods were initially modeled as a Gaussian process, which\n        underestimated the frequency of extreme events.\n\n        It is one of a class of extreme value distributions, the Generalized\n        Extreme Value (GEV) distributions, which also includes the Weibull and\n        Frechet.\n\n        The function has a mean of :math:`\\mu + 0.57721\\beta` and a variance\n        of :math:`\\frac{\\pi^2}{6}\\beta^2`.\n\n        References\n        ----------\n        .. [1] Gumbel, E. J., \"Statistics of Extremes,\"\n               New York: Columbia University Press, 1958.\n        .. [2] Reiss, R.-D. and Thomas, M., \"Statistical Analysis of Extreme\n               Values from Insurance, Finance, Hydrology and Other Fields,\"\n               Basel: Birkhauser Verlag, 2001.\n\n        Examples\n        --------\n        Draw samples from the distribution:\n\n        >>> mu, beta = 0, 0.1 # location and scale\n        >>> s = np.random.gumbel(mu, beta, 1000)\n\n        Display the histogram of the samples, along with\n        the probability density function:\n\n        >>> import matplotlib.pyplot as plt\n        >>> count, bins, ignored = plt.hist(s, 30, density=True)\n        >>> plt.plot(bins, (1/beta)*np.exp(-(bins - mu)/beta)\n        ...          * np.exp( -np.exp( -(bins - mu) /beta) ),\n        ...          linewidth=2, color='r')\n        >>> plt.show()\n\n        Show how an extreme value distribution can arise from a Gaussian process\n        and compare to a Gaussian:\n\n        >>> means = []\n        >>> maxima = []\n   ""     >>> for i in range(0,1000) :\n        ...    a = np.random.normal(mu, beta, 1000)\n        ...    means.append(a.mean())\n        ...    maxima.append(a.max())\n        >>> count, bins, ignored = plt.hist(maxima, 30, density=True)\n        >>> beta = np.std(maxima) * np.sqrt(6) / np.pi\n        >>> mu = np.mean(maxima) - 0.57721*beta\n        >>> plt.plot(bins, (1/beta)*np.exp(-(bins - mu)/beta)\n        ...          * np.exp(-np.exp(-(bins - mu)/beta)),\n        ...          linewidth=2, color='r')\n        >>> plt.plot(bins, 1/(beta * np.sqrt(2 * np.pi))\n        ...          * np.exp(-(bins - mu)**2 / (2 * beta**2)),\n        ...          linewidth=2, color='g')\n        >>> plt.show()\n\n        ";
-static const char __pyx_k_hypergeometric_ngood_nbad_nsamp[] = "\n        hypergeometric(ngood, nbad, nsample, size=None)\n\n        Draw samples from a Hypergeometric distribution.\n\n        Samples are drawn from a hypergeometric distribution with specified\n        parameters, ngood (ways to make a good selection), nbad (ways to make\n        a bad selection), and nsample = number of items sampled, which is less\n        than or equal to the sum ngood + nbad.\n\n        Parameters\n        ----------\n        ngood : int or array_like of ints\n            Number of ways to make a good selection.  Must be nonnegative.\n        nbad : int or array_like of ints\n            Number of ways to make a bad selection.  Must be nonnegative.\n        nsample : int or array_like of ints\n            Number of items sampled.  Must be at least 1 and at most\n            ``ngood + nbad``.\n        size : int or tuple of ints, optional\n            Output shape.  If the given shape is, e.g., ``(m, n, k)``, then\n            ``m * n * k`` samples are drawn.  If size is ``None`` (default),\n            a single value is returned if ``ngood``, ``nbad``, and ``nsample``\n            are all scalars.  Otherwise, ``np.broadcast(ngood, nbad, nsample).size``\n            samples are drawn.\n\n        Returns\n        -------\n        out : ndarray or scalar\n            Drawn samples from the parameterized hypergeometric distribution.\n\n        See Also\n        --------\n        scipy.stats.hypergeom : probability density function, distribution or\n            cumulative density function, etc.\n\n        Notes\n        -----\n        The probability density for the Hypergeometric distribution is\n\n        .. math:: P(x) = \\frac{\\binom{g}{x}\\binom{b}{n-x}}{\\binom{g+b}{n}},\n\n        where :math:`0 \\le x \\le n` and :math:`n-b \\le x \\le g`\n\n        for P(x) the probability of x successes, g = ngood, b = nbad, and\n        n = number of samples.\n\n        Consider an urn with black and white marbles in it, ngood of them\n        black a""nd nbad are white. If you draw nsample balls without\n        replacement, then the hypergeometric distribution describes the\n        distribution of black balls in the drawn sample.\n\n        Note that this distribution is very similar to the binomial\n        distribution, except that in this case, samples are drawn without\n        replacement, whereas in the Binomial case samples are drawn with\n        replacement (or the sample space is infinite). As the sample space\n        becomes large, this distribution approaches the binomial.\n\n        References\n        ----------\n        .. [1] Lentner, Marvin, \"Elementary Applied Statistics\", Bogden\n               and Quigley, 1972.\n        .. [2] Weisstein, Eric W. \"Hypergeometric Distribution.\" From\n               MathWorld--A Wolfram Web Resource.\n               http://mathworld.wolfram.com/HypergeometricDistribution.html\n        .. [3] Wikipedia, \"Hypergeometric distribution\",\n               https://en.wikipedia.org/wiki/Hypergeometric_distribution\n\n        Examples\n        --------\n        Draw samples from the distribution:\n\n        >>> ngood, nbad, nsamp = 100, 2, 10\n        # number of good, number of bad, and number of samples\n        >>> s = np.random.hypergeometric(ngood, nbad, nsamp, 1000)\n        >>> hist(s)\n        #   note that it is very unlikely to grab both bad items\n\n        Suppose you have an urn with 15 white and 15 black marbles.\n        If you pull 15 marbles at random, how likely is it that\n        12 or more of them are one color?\n\n        >>> s = np.random.hypergeometric(15, 15, 15, 100000)\n        >>> sum(s>=12)/100000. + sum(s<=3)/100000.\n        #   answer = 0.003 ... pretty unlikely!\n\n        ";
-static const char __pyx_k_logistic_loc_0_0_scale_1_0_size[] = "\n        logistic(loc=0.0, scale=1.0, size=None)\n\n        Draw samples from a logistic distribution.\n\n        Samples are drawn from a logistic distribution with specified\n        parameters, loc (location or mean, also median), and scale (>0).\n\n        Parameters\n        ----------\n        loc : float or array_like of floats, optional\n            Parameter of the distribution. Default is 0.\n        scale : float or array_like of floats, optional\n            Parameter of the distribution. Should be greater than zero.\n            Default is 1.\n        size : int or tuple of ints, optional\n            Output shape.  If the given shape is, e.g., ``(m, n, k)``, then\n            ``m * n * k`` samples are drawn.  If size is ``None`` (default),\n            a single value is returned if ``loc`` and ``scale`` are both scalars.\n            Otherwise, ``np.broadcast(loc, scale).size`` samples are drawn.\n\n        Returns\n        -------\n        out : ndarray or scalar\n            Drawn samples from the parameterized logistic distribution.\n\n        See Also\n        --------\n        scipy.stats.logistic : probability density function, distribution or\n            cumulative density function, etc.\n\n        Notes\n        -----\n        The probability density for the Logistic distribution is\n\n        .. math:: P(x) = P(x) = \\frac{e^{-(x-\\mu)/s}}{s(1+e^{-(x-\\mu)/s})^2},\n\n        where :math:`\\mu` = location and :math:`s` = scale.\n\n        The Logistic distribution is used in Extreme Value problems where it\n        can act as a mixture of Gumbel distributions, in Epidemiology, and by\n        the World Chess Federation (FIDE) where it is used in the Elo ranking\n        system, assuming the performance of each player is a logistically\n        distributed random variable.\n\n        References\n        ----------\n        .. [1] Reiss, R.-D. and Thomas M. (2001), \"Statistical Analysis of\n               Extreme Values, from Insurance, Financ""e, Hydrology and Other\n               Fields,\" Birkhauser Verlag, Basel, pp 132-133.\n        .. [2] Weisstein, Eric W. \"Logistic Distribution.\" From\n               MathWorld--A Wolfram Web Resource.\n               http://mathworld.wolfram.com/LogisticDistribution.html\n        .. [3] Wikipedia, \"Logistic-distribution\",\n               https://en.wikipedia.org/wiki/Logistic_distribution\n\n        Examples\n        --------\n        Draw samples from the distribution:\n\n        >>> loc, scale = 10, 1\n        >>> s = np.random.logistic(loc, scale, 10000)\n        >>> count, bins, ignored = plt.hist(s, bins=50)\n\n        #   plot against distribution\n\n        >>> def logist(x, loc, scale):\n        ...     return exp((loc-x)/scale)/(scale*(1+exp((loc-x)/scale))**2)\n        >>> plt.plot(bins, logist(bins, loc, scale)*count.max()/\\\n        ... logist(bins, loc, scale).max())\n        >>> plt.show()\n\n        ";
+static const char __pyx_k_hypergeometric_ngood_nbad_nsamp[] = "\n        hypergeometric(ngood, nbad, nsample, size=None)\n\n        Draw samples from a Hypergeometric distribution.\n\n        Samples are drawn from a hypergeometric distribution with specified\n        parameters, ngood (ways to make a good selection), nbad (ways to make\n        a bad selection), and nsample = number of items sampled, which is less\n        than or equal to the sum ngood + nbad.\n\n        Parameters\n        ----------\n        ngood : int or array_like of ints\n            Number of ways to make a good selection.  Must be nonnegative.\n        nbad : int or array_like of ints\n            Number of ways to make a bad selection.  Must be nonnegative.\n        nsample : int or array_like of ints\n            Number of items sampled.  Must be at least 1 and at most\n            ``ngood + nbad``.\n        size : int or tuple of ints, optional\n            Output shape.  If the given shape is, e.g., ``(m, n, k)``, then\n            ``m * n * k`` samples are drawn.  If size is ``None`` (default),\n            a single value is returned if ``ngood``, ``nbad``, and ``nsample``\n            are all scalars.  Otherwise, ``np.broadcast(ngood, nbad, nsample).size``\n            samples are drawn.\n\n        Returns\n        -------\n        out : ndarray or scalar\n            Drawn samples from the parameterized hypergeometric distribution.\n\n        See Also\n        --------\n        scipy.stats.hypergeom : probability density function, distribution or\n            cumulative density function, etc.\n\n        Notes\n        -----\n        The probability density for the Hypergeometric distribution is\n\n        .. math:: P(x) = \\frac{\\binom{g}{x}\\binom{b}{n-x}}{\\binom{g+b}{n}},\n\n        where :math:`0 \\le x \\le n` and :math:`n-b \\le x \\le g`\n\n        for P(x) the probability of x successes, g = ngood, b = nbad, and\n        n = number of samples.\n\n        Consider an urn with black and white marbles in it, ngood of them\n        black a""nd nbad are white. If you draw nsample balls without\n        replacement, then the hypergeometric distribution describes the\n        distribution of black balls in the drawn sample.\n\n        Note that this distribution is very similar to the binomial\n        distribution, except that in this case, samples are drawn without\n        replacement, whereas in the Binomial case samples are drawn with\n        replacement (or the sample space is infinite). As the sample space\n        becomes large, this distribution approaches the binomial.\n\n        References\n        ----------\n        .. [1] Lentner, Marvin, \"Elementary Applied Statistics\", Bogden\n               and Quigley, 1972.\n        .. [2] Weisstein, Eric W. \"Hypergeometric Distribution.\" From\n               MathWorld--A Wolfram Web Resource.\n               http://mathworld.wolfram.com/HypergeometricDistribution.html\n        .. [3] Wikipedia, \"Hypergeometric distribution\",\n               https://en.wikipedia.org/wiki/Hypergeometric_distribution\n\n        Examples\n        --------\n        Draw samples from the distribution:\n\n        >>> ngood, nbad, nsamp = 100, 2, 10\n        # number of good, number of bad, and number of samples\n        >>> s = np.random.hypergeometric(ngood, nbad, nsamp, 1000)\n        >>> from matplotlib.pyplot import hist\n        >>> hist(s)\n        #   note that it is very unlikely to grab both bad items\n\n        Suppose you have an urn with 15 white and 15 black marbles.\n        If you pull 15 marbles at random, how likely is it that\n        12 or more of them are one color?\n\n        >>> s = np.random.hypergeometric(15, 15, 15, 100000)\n        >>> sum(s>=12)/100000. + sum(s<=3)/100000.\n        #   answer = 0.003 ... pretty unlikely!\n\n        ";
+static const char __pyx_k_logistic_loc_0_0_scale_1_0_size[] = "\n        logistic(loc=0.0, scale=1.0, size=None)\n\n        Draw samples from a logistic distribution.\n\n        Samples are drawn from a logistic distribution with specified\n        parameters, loc (location or mean, also median), and scale (>0).\n\n        Parameters\n        ----------\n        loc : float or array_like of floats, optional\n            Parameter of the distribution. Default is 0.\n        scale : float or array_like of floats, optional\n            Parameter of the distribution. Should be greater than zero.\n            Default is 1.\n        size : int or tuple of ints, optional\n            Output shape.  If the given shape is, e.g., ``(m, n, k)``, then\n            ``m * n * k`` samples are drawn.  If size is ``None`` (default),\n            a single value is returned if ``loc`` and ``scale`` are both scalars.\n            Otherwise, ``np.broadcast(loc, scale).size`` samples are drawn.\n\n        Returns\n        -------\n        out : ndarray or scalar\n            Drawn samples from the parameterized logistic distribution.\n\n        See Also\n        --------\n        scipy.stats.logistic : probability density function, distribution or\n            cumulative density function, etc.\n\n        Notes\n        -----\n        The probability density for the Logistic distribution is\n\n        .. math:: P(x) = P(x) = \\frac{e^{-(x-\\mu)/s}}{s(1+e^{-(x-\\mu)/s})^2},\n\n        where :math:`\\mu` = location and :math:`s` = scale.\n\n        The Logistic distribution is used in Extreme Value problems where it\n        can act as a mixture of Gumbel distributions, in Epidemiology, and by\n        the World Chess Federation (FIDE) where it is used in the Elo ranking\n        system, assuming the performance of each player is a logistically\n        distributed random variable.\n\n        References\n        ----------\n        .. [1] Reiss, R.-D. and Thomas M. (2001), \"Statistical Analysis of\n               Extreme Values, from Insurance, Financ""e, Hydrology and Other\n               Fields,\" Birkhauser Verlag, Basel, pp 132-133.\n        .. [2] Weisstein, Eric W. \"Logistic Distribution.\" From\n               MathWorld--A Wolfram Web Resource.\n               http://mathworld.wolfram.com/LogisticDistribution.html\n        .. [3] Wikipedia, \"Logistic-distribution\",\n               https://en.wikipedia.org/wiki/Logistic_distribution\n\n        Examples\n        --------\n        Draw samples from the distribution:\n\n        >>> loc, scale = 10, 1\n        >>> s = np.random.logistic(loc, scale, 10000)\n        >>> import matplotlib.pyplot as plt\n        >>> count, bins, ignored = plt.hist(s, bins=50)\n\n        #   plot against distribution\n\n        >>> def logist(x, loc, scale):\n        ...     return exp((loc-x)/scale)/(scale*(1+exp((loc-x)/scale))**2)\n        >>> plt.plot(bins, logist(bins, loc, scale)*count.max()/\\\n        ... logist(bins, loc, scale).max())\n        >>> plt.show()\n\n        ";
 static const char __pyx_k_lognormal_mean_0_0_sigma_1_0_si[] = "\n        lognormal(mean=0.0, sigma=1.0, size=None)\n\n        Draw samples from a log-normal distribution.\n\n        Draw samples from a log-normal distribution with specified mean,\n        standard deviation, and array shape.  Note that the mean and standard\n        deviation are not the values for the distribution itself, but of the\n        underlying normal distribution it is derived from.\n\n        Parameters\n        ----------\n        mean : float or array_like of floats, optional\n            Mean value of the underlying normal distribution. Default is 0.\n        sigma : float or array_like of floats, optional\n            Standard deviation of the underlying normal distribution. Should\n            be greater than zero. Default is 1.\n        size : int or tuple of ints, optional\n            Output shape.  If the given shape is, e.g., ``(m, n, k)``, then\n            ``m * n * k`` samples are drawn.  If size is ``None`` (default),\n            a single value is returned if ``mean`` and ``sigma`` are both scalars.\n            Otherwise, ``np.broadcast(mean, sigma).size`` samples are drawn.\n\n        Returns\n        -------\n        out : ndarray or scalar\n            Drawn samples from the parameterized log-normal distribution.\n\n        See Also\n        --------\n        scipy.stats.lognorm : probability density function, distribution,\n            cumulative density function, etc.\n\n        Notes\n        -----\n        A variable `x` has a log-normal distribution if `log(x)` is normally\n        distributed.  The probability density function for the log-normal\n        distribution is:\n\n        .. math:: p(x) = \\frac{1}{\\sigma x \\sqrt{2\\pi}}\n                         e^{(-\\frac{(ln(x)-\\mu)^2}{2\\sigma^2})}\n\n        where :math:`\\mu` is the mean and :math:`\\sigma` is the standard\n        deviation of the normally distributed logarithm of the variable.\n        A log-normal distribution results if a random variable is the *produc""t*\n        of a large number of independent, identically-distributed variables in\n        the same way that a normal distribution results if the variable is the\n        *sum* of a large number of independent, identically-distributed\n        variables.\n\n        References\n        ----------\n        .. [1] Limpert, E., Stahel, W. A., and Abbt, M., \"Log-normal\n               Distributions across the Sciences: Keys and Clues,\"\n               BioScience, Vol. 51, No. 5, May, 2001.\n               https://stat.ethz.ch/~stahel/lognormal/bioscience.pdf\n        .. [2] Reiss, R.D. and Thomas, M., \"Statistical Analysis of Extreme\n               Values,\" Basel: Birkhauser Verlag, 2001, pp. 31-32.\n\n        Examples\n        --------\n        Draw samples from the distribution:\n\n        >>> mu, sigma = 3., 1. # mean and standard deviation\n        >>> s = np.random.lognormal(mu, sigma, 1000)\n\n        Display the histogram of the samples, along with\n        the probability density function:\n\n        >>> import matplotlib.pyplot as plt\n        >>> count, bins, ignored = plt.hist(s, 100, density=True, align='mid')\n\n        >>> x = np.linspace(min(bins), max(bins), 10000)\n        >>> pdf = (np.exp(-(np.log(x) - mu)**2 / (2 * sigma**2))\n        ...        / (x * sigma * np.sqrt(2 * np.pi)))\n\n        >>> plt.plot(x, pdf, linewidth=2, color='r')\n        >>> plt.axis('tight')\n        >>> plt.show()\n\n        Demonstrate that taking the products of random samples from a uniform\n        distribution can be fit well by a log-normal probability density\n        function.\n\n        >>> # Generate a thousand samples: each is the product of 100 random\n        >>> # values, drawn from a normal distribution.\n        >>> b = []\n        >>> for i in range(1000):\n        ...    a = 10. + np.random.random(100)\n        ...    b.append(np.product(a))\n\n        >>> b = np.array(b) / np.min(b) # scale values to be positive\n        >>> count, bins, ignored = plt"".hist(b, 100, density=True, align='mid')\n        >>> sigma = np.std(np.log(b))\n        >>> mu = np.mean(np.log(b))\n\n        >>> x = np.linspace(min(bins), max(bins), 10000)\n        >>> pdf = (np.exp(-(np.log(x) - mu)**2 / (2 * sigma**2))\n        ...        / (x * sigma * np.sqrt(2 * np.pi)))\n\n        >>> plt.plot(x, pdf, color='r', linewidth=2)\n        >>> plt.show()\n\n        ";
-static const char __pyx_k_logseries_p_size_None_Draw_samp[] = "\n        logseries(p, size=None)\n\n        Draw samples from a logarithmic series distribution.\n\n        Samples are drawn from a log series distribution with specified\n        shape parameter, 0 < ``p`` < 1.\n\n        Parameters\n        ----------\n        p : float or array_like of floats\n            Shape parameter for the distribution.  Must be in the range (0, 1).\n        size : int or tuple of ints, optional\n            Output shape.  If the given shape is, e.g., ``(m, n, k)``, then\n            ``m * n * k`` samples are drawn.  If size is ``None`` (default),\n            a single value is returned if ``p`` is a scalar.  Otherwise,\n            ``np.array(p).size`` samples are drawn.\n\n        Returns\n        -------\n        out : ndarray or scalar\n            Drawn samples from the parameterized logarithmic series distribution.\n\n        See Also\n        --------\n        scipy.stats.logser : probability density function, distribution or\n            cumulative density function, etc.\n\n        Notes\n        -----\n        The probability density for the Log Series distribution is\n\n        .. math:: P(k) = \\frac{-p^k}{k \\ln(1-p)},\n\n        where p = probability.\n\n        The log series distribution is frequently used to represent species\n        richness and occurrence, first proposed by Fisher, Corbet, and\n        Williams in 1943 [2].  It may also be used to model the numbers of\n        occupants seen in cars [3].\n\n        References\n        ----------\n        .. [1] Buzas, Martin A.; Culver, Stephen J.,  Understanding regional\n               species diversity through the log series distribution of\n               occurrences: BIODIVERSITY RESEARCH Diversity & Distributions,\n               Volume 5, Number 5, September 1999 , pp. 187-195(9).\n        .. [2] Fisher, R.A,, A.S. Corbet, and C.B. Williams. 1943. The\n               relation between the number of species and the number of\n               individuals in a random ""sample of an animal population.\n               Journal of Animal Ecology, 12:42-58.\n        .. [3] D. J. Hand, F. Daly, D. Lunn, E. Ostrowski, A Handbook of Small\n               Data Sets, CRC Press, 1994.\n        .. [4] Wikipedia, \"Logarithmic distribution\",\n               https://en.wikipedia.org/wiki/Logarithmic_distribution\n\n        Examples\n        --------\n        Draw samples from the distribution:\n\n        >>> a = .6\n        >>> s = np.random.logseries(a, 10000)\n        >>> count, bins, ignored = plt.hist(s)\n\n        #   plot against distribution\n\n        >>> def logseries(k, p):\n        ...     return -p**k/(k*log(1-p))\n        >>> plt.plot(bins, logseries(bins, a)*count.max()/\n                     logseries(bins, a).max(), 'r')\n        >>> plt.show()\n\n        ";
+static const char __pyx_k_logseries_p_size_None_Draw_samp[] = "\n        logseries(p, size=None)\n\n        Draw samples from a logarithmic series distribution.\n\n        Samples are drawn from a log series distribution with specified\n        shape parameter, 0 < ``p`` < 1.\n\n        Parameters\n        ----------\n        p : float or array_like of floats\n            Shape parameter for the distribution.  Must be in the range (0, 1).\n        size : int or tuple of ints, optional\n            Output shape.  If the given shape is, e.g., ``(m, n, k)``, then\n            ``m * n * k`` samples are drawn.  If size is ``None`` (default),\n            a single value is returned if ``p`` is a scalar.  Otherwise,\n            ``np.array(p).size`` samples are drawn.\n\n        Returns\n        -------\n        out : ndarray or scalar\n            Drawn samples from the parameterized logarithmic series distribution.\n\n        See Also\n        --------\n        scipy.stats.logser : probability density function, distribution or\n            cumulative density function, etc.\n\n        Notes\n        -----\n        The probability density for the Log Series distribution is\n\n        .. math:: P(k) = \\frac{-p^k}{k \\ln(1-p)},\n\n        where p = probability.\n\n        The log series distribution is frequently used to represent species\n        richness and occurrence, first proposed by Fisher, Corbet, and\n        Williams in 1943 [2].  It may also be used to model the numbers of\n        occupants seen in cars [3].\n\n        References\n        ----------\n        .. [1] Buzas, Martin A.; Culver, Stephen J.,  Understanding regional\n               species diversity through the log series distribution of\n               occurrences: BIODIVERSITY RESEARCH Diversity & Distributions,\n               Volume 5, Number 5, September 1999 , pp. 187-195(9).\n        .. [2] Fisher, R.A,, A.S. Corbet, and C.B. Williams. 1943. The\n               relation between the number of species and the number of\n               individuals in a random ""sample of an animal population.\n               Journal of Animal Ecology, 12:42-58.\n        .. [3] D. J. Hand, F. Daly, D. Lunn, E. Ostrowski, A Handbook of Small\n               Data Sets, CRC Press, 1994.\n        .. [4] Wikipedia, \"Logarithmic distribution\",\n               https://en.wikipedia.org/wiki/Logarithmic_distribution\n\n        Examples\n        --------\n        Draw samples from the distribution:\n\n        >>> a = .6\n        >>> s = np.random.logseries(a, 10000)\n        >>> import matplotlib.pyplot as plt\n        >>> count, bins, ignored = plt.hist(s)\n\n        #   plot against distribution\n\n        >>> def logseries(k, p):\n        ...     return -p**k/(k*log(1-p))\n        >>> plt.plot(bins, logseries(bins, a)*count.max()/\n                     logseries(bins, a).max(), 'r')\n        >>> plt.show()\n\n        ";
 static const char __pyx_k_multinomial_n_pvals_size_None_D[] = "\n        multinomial(n, pvals, size=None)\n\n        Draw samples from a multinomial distribution.\n\n        The multinomial distribution is a multivariate generalisation of the\n        binomial distribution.  Take an experiment with one of ``p``\n        possible outcomes.  An example of such an experiment is throwing a dice,\n        where the outcome can be 1 through 6.  Each sample drawn from the\n        distribution represents `n` such experiments.  Its values,\n        ``X_i = [X_0, X_1, ..., X_p]``, represent the number of times the\n        outcome was ``i``.\n\n        Parameters\n        ----------\n        n : int\n            Number of experiments.\n        pvals : sequence of floats, length p\n            Probabilities of each of the ``p`` different outcomes.  These\n            should sum to 1 (however, the last element is always assumed to\n            account for the remaining probability, as long as\n            ``sum(pvals[:-1]) <= 1)``.\n        size : int or tuple of ints, optional\n            Output shape.  If the given shape is, e.g., ``(m, n, k)``, then\n            ``m * n * k`` samples are drawn.  Default is None, in which case a\n            single value is returned.\n\n        Returns\n        -------\n        out : ndarray\n            The drawn samples, of shape *size*, if that was provided.  If not,\n            the shape is ``(N,)``.\n\n            In other words, each entry ``out[i,j,...,:]`` is an N-dimensional\n            value drawn from the distribution.\n\n        Examples\n        --------\n        Throw a dice 20 times:\n\n        >>> np.random.multinomial(20, [1/6.]*6, size=1)\n        array([[4, 1, 7, 5, 2, 1]])\n\n        It landed 4 times on 1, once on 2, etc.\n\n        Now, throw the dice 20 times, and 20 times again:\n\n        >>> np.random.multinomial(20, [1/6.]*6, size=2)\n        array([[3, 4, 3, 3, 4, 3],\n               [2, 4, 3, 4, 0, 7]])\n\n        For the first run, we threw 3 times 1, 4 times 2, etc.  Fo""r the second,\n        we threw 2 times 1, 4 times 2, etc.\n\n        A loaded die is more likely to land on number 6:\n\n        >>> np.random.multinomial(100, [1/7.]*5 + [2/7.])\n        array([11, 16, 14, 17, 16, 26])\n\n        The probability inputs should be normalized. As an implementation\n        detail, the value of the last entry is ignored and assumed to take\n        up any leftover probability mass, but this should not be relied on.\n        A biased coin which has twice as much weight on one side as on the\n        other should be sampled like so:\n\n        >>> np.random.multinomial(100, [1.0 / 3, 2.0 / 3])  # RIGHT\n        array([38, 62])\n\n        not like:\n\n        >>> np.random.multinomial(100, [1.0, 2.0])  # WRONG\n        array([100,   0])\n\n        ";
 static const char __pyx_k_multivariate_normal_mean_cov_si[] = "\n        multivariate_normal(mean, cov[, size, check_valid, tol])\n\n        Draw random samples from a multivariate normal distribution.\n\n        The multivariate normal, multinormal or Gaussian distribution is a\n        generalization of the one-dimensional normal distribution to higher\n        dimensions.  Such a distribution is specified by its mean and\n        covariance matrix.  These parameters are analogous to the mean\n        (average or \"center\") and variance (standard deviation, or \"width,\"\n        squared) of the one-dimensional normal distribution.\n\n        Parameters\n        ----------\n        mean : 1-D array_like, of length N\n            Mean of the N-dimensional distribution.\n        cov : 2-D array_like, of shape (N, N)\n            Covariance matrix of the distribution. It must be symmetric and\n            positive-semidefinite for proper sampling.\n        size : int or tuple of ints, optional\n            Given a shape of, for example, ``(m,n,k)``, ``m*n*k`` samples are\n            generated, and packed in an `m`-by-`n`-by-`k` arrangement.  Because\n            each sample is `N`-dimensional, the output shape is ``(m,n,k,N)``.\n            If no shape is specified, a single (`N`-D) sample is returned.\n        check_valid : { 'warn', 'raise', 'ignore' }, optional\n            Behavior when the covariance matrix is not positive semidefinite.\n        tol : float, optional\n            Tolerance when checking the singular values in covariance matrix.\n\n        Returns\n        -------\n        out : ndarray\n            The drawn samples, of shape *size*, if that was provided.  If not,\n            the shape is ``(N,)``.\n\n            In other words, each entry ``out[i,j,...,:]`` is an N-dimensional\n            value drawn from the distribution.\n\n        Notes\n        -----\n        The mean is a coordinate in N-dimensional space, which represents the\n        location where samples are most likely to be generated.  This ""is\n        analogous to the peak of the bell curve for the one-dimensional or\n        univariate normal distribution.\n\n        Covariance indicates the level to which two variables vary together.\n        From the multivariate normal distribution, we draw N-dimensional\n        samples, :math:`X = [x_1, x_2, ... x_N]`.  The covariance matrix\n        element :math:`C_{ij}` is the covariance of :math:`x_i` and :math:`x_j`.\n        The element :math:`C_{ii}` is the variance of :math:`x_i` (i.e. its\n        \"spread\").\n\n        Instead of specifying the full covariance matrix, popular\n        approximations include:\n\n          - Spherical covariance (`cov` is a multiple of the identity matrix)\n          - Diagonal covariance (`cov` has non-negative elements, and only on\n            the diagonal)\n\n        This geometrical property can be seen in two dimensions by plotting\n        generated data-points:\n\n        >>> mean = [0, 0]\n        >>> cov = [[1, 0], [0, 100]]  # diagonal covariance\n\n        Diagonal covariance means that points are oriented along x or y-axis:\n\n        >>> import matplotlib.pyplot as plt\n        >>> x, y = np.random.multivariate_normal(mean, cov, 5000).T\n        >>> plt.plot(x, y, 'x')\n        >>> plt.axis('equal')\n        >>> plt.show()\n\n        Note that the covariance matrix must be positive semidefinite (a.k.a.\n        nonnegative-definite). Otherwise, the behavior of this method is\n        undefined and backwards compatibility is not guaranteed.\n\n        References\n        ----------\n        .. [1] Papoulis, A., \"Probability, Random Variables, and Stochastic\n               Processes,\" 3rd ed., New York: McGraw-Hill, 1991.\n        .. [2] Duda, R. O., Hart, P. E., and Stork, D. G., \"Pattern\n               Classification,\" 2nd ed., New York: Wiley, 2001.\n\n        Examples\n        --------\n        >>> mean = (1, 2)\n        >>> cov = [[1, 0], [0, 1]]\n        >>> x = np.random.multivariate_normal(mean"", cov, (3, 3))\n        >>> x.shape\n        (3, 3, 2)\n\n        The following is probably true, given that 0.6 is roughly twice the\n        standard deviation:\n\n        >>> list((x[0,0,:] - mean) < 0.6)\n        [True, True]\n\n        ";
 static const char __pyx_k_negative_binomial_n_p_size_None[] = "\n        negative_binomial(n, p, size=None)\n\n        Draw samples from a negative binomial distribution.\n\n        Samples are drawn from a negative binomial distribution with specified\n        parameters, `n` successes and `p` probability of success where `n` is an\n        integer > 0 and `p` is in the interval [0, 1].\n\n        Parameters\n        ----------\n        n : int or array_like of ints\n            Parameter of the distribution, > 0. Floats are also accepted,\n            but they will be truncated to integers.\n        p : float or array_like of floats\n            Parameter of the distribution, >= 0 and <=1.\n        size : int or tuple of ints, optional\n            Output shape.  If the given shape is, e.g., ``(m, n, k)``, then\n            ``m * n * k`` samples are drawn.  If size is ``None`` (default),\n            a single value is returned if ``n`` and ``p`` are both scalars.\n            Otherwise, ``np.broadcast(n, p).size`` samples are drawn.\n\n        Returns\n        -------\n        out : ndarray or scalar\n            Drawn samples from the parameterized negative binomial distribution,\n            where each sample is equal to N, the number of failures that\n            occurred before a total of n successes was reached.\n\n        Notes\n        -----\n        The probability density for the negative binomial distribution is\n\n        .. math:: P(N;n,p) = \\binom{N+n-1}{N}p^{n}(1-p)^{N},\n\n        where :math:`n` is the number of successes, :math:`p` is the\n        probability of success, and :math:`N+n` is the number of trials.\n        The negative binomial distribution gives the probability of N\n        failures given n successes, with a success on the last trial.\n\n        If one throws a die repeatedly until the third time a \"1\" appears,\n        then the probability distribution of the number of non-\"1\"s that\n        appear before the third \"1\" is a negative binomial distribution.\n\n        References\n       "" ----------\n        .. [1] Weisstein, Eric W. \"Negative Binomial Distribution.\" From\n               MathWorld--A Wolfram Web Resource.\n               http://mathworld.wolfram.com/NegativeBinomialDistribution.html\n        .. [2] Wikipedia, \"Negative binomial distribution\",\n               https://en.wikipedia.org/wiki/Negative_binomial_distribution\n\n        Examples\n        --------\n        Draw samples from the distribution:\n\n        A real world example. A company drills wild-cat oil\n        exploration wells, each with an estimated probability of\n        success of 0.1.  What is the probability of having one success\n        for each successive well, that is what is the probability of a\n        single success after drilling 5 wells, after 6 wells, etc.?\n\n        >>> s = np.random.negative_binomial(1, 0.1, 100000)\n        >>> for i in range(1, 11):\n        ...    probability = sum(s<i) / 100000.\n        ...    print i, \"wells drilled, probability of one success =\", probability\n\n        ";
 static const char __pyx_k_noncentral_chisquare_df_nonc_si[] = "\n        noncentral_chisquare(df, nonc, size=None)\n\n        Draw samples from a noncentral chi-square distribution.\n\n        The noncentral :math:`\\chi^2` distribution is a generalisation of\n        the :math:`\\chi^2` distribution.\n\n        Parameters\n        ----------\n        df : float or array_like of floats\n            Degrees of freedom, should be > 0.\n\n            .. versionchanged:: 1.10.0\n               Earlier NumPy versions required dfnum > 1.\n        nonc : float or array_like of floats\n            Non-centrality, should be non-negative.\n        size : int or tuple of ints, optional\n            Output shape.  If the given shape is, e.g., ``(m, n, k)``, then\n            ``m * n * k`` samples are drawn.  If size is ``None`` (default),\n            a single value is returned if ``df`` and ``nonc`` are both scalars.\n            Otherwise, ``np.broadcast(df, nonc).size`` samples are drawn.\n\n        Returns\n        -------\n        out : ndarray or scalar\n            Drawn samples from the parameterized noncentral chi-square distribution.\n\n        Notes\n        -----\n        The probability density function for the noncentral Chi-square\n        distribution is\n\n        .. math:: P(x;df,nonc) = \\sum^{\\infty}_{i=0}\n                               \\frac{e^{-nonc/2}(nonc/2)^{i}}{i!}\n                               \\P_{Y_{df+2i}}(x),\n\n        where :math:`Y_{q}` is the Chi-square with q degrees of freedom.\n\n        In Delhi (2007), it is noted that the noncentral chi-square is\n        useful in bombing and coverage problems, the probability of\n        killing the point target given by the noncentral chi-squared\n        distribution.\n\n        References\n        ----------\n        .. [1] Delhi, M.S. Holla, \"On a noncentral chi-square distribution in\n               the analysis of weapon systems effectiveness\", Metrika,\n               Volume 15, Number 1 / December, 1970.\n        .. [2] Wikipedia, \"Noncentral chi-s""quared distribution\"\n               https://en.wikipedia.org/wiki/Noncentral_chi-squared_distribution\n\n        Examples\n        --------\n        Draw values from the distribution and plot the histogram\n\n        >>> import matplotlib.pyplot as plt\n        >>> values = plt.hist(np.random.noncentral_chisquare(3, 20, 100000),\n        ...                   bins=200, density=True)\n        >>> plt.show()\n\n        Draw values from a noncentral chisquare with very small noncentrality,\n        and compare to a chisquare.\n\n        >>> plt.figure()\n        >>> values = plt.hist(np.random.noncentral_chisquare(3, .0000001, 100000),\n        ...                   bins=np.arange(0., 25, .1), density=True)\n        >>> values2 = plt.hist(np.random.chisquare(3, 100000),\n        ...                    bins=np.arange(0., 25, .1), density=True)\n        >>> plt.plot(values[1][0:-1], values[0]-values2[0], 'ob')\n        >>> plt.show()\n\n        Demonstrate how large values of non-centrality lead to a more symmetric\n        distribution.\n\n        >>> plt.figure()\n        >>> values = plt.hist(np.random.noncentral_chisquare(3, 20, 100000),\n        ...                   bins=200, density=True)\n        >>> plt.show()\n\n        ";
-static const char __pyx_k_noncentral_f_dfnum_dfden_nonc_s[] = "\n        noncentral_f(dfnum, dfden, nonc, size=None)\n\n        Draw samples from the noncentral F distribution.\n\n        Samples are drawn from an F distribution with specified parameters,\n        `dfnum` (degrees of freedom in numerator) and `dfden` (degrees of\n        freedom in denominator), where both parameters > 1.\n        `nonc` is the non-centrality parameter.\n\n        Parameters\n        ----------\n        dfnum : float or array_like of floats\n            Numerator degrees of freedom, should be > 0.\n\n            .. versionchanged:: 1.14.0\n               Earlier NumPy versions required dfnum > 1.\n        dfden : float or array_like of floats\n            Denominator degrees of freedom, should be > 0.\n        nonc : float or array_like of floats\n            Non-centrality parameter, the sum of the squares of the numerator\n            means, should be >= 0.\n        size : int or tuple of ints, optional\n            Output shape.  If the given shape is, e.g., ``(m, n, k)``, then\n            ``m * n * k`` samples are drawn.  If size is ``None`` (default),\n            a single value is returned if ``dfnum``, ``dfden``, and ``nonc``\n            are all scalars.  Otherwise, ``np.broadcast(dfnum, dfden, nonc).size``\n            samples are drawn.\n\n        Returns\n        -------\n        out : ndarray or scalar\n            Drawn samples from the parameterized noncentral Fisher distribution.\n\n        Notes\n        -----\n        When calculating the power of an experiment (power = probability of\n        rejecting the null hypothesis when a specific alternative is true) the\n        non-central F statistic becomes important.  When the null hypothesis is\n        true, the F statistic follows a central F distribution. When the null\n        hypothesis is not true, then it follows a non-central F statistic.\n\n        References\n        ----------\n        .. [1] Weisstein, Eric W. \"Noncentral F-Distribution.\"\n               From MathW""orld--A Wolfram Web Resource.\n               http://mathworld.wolfram.com/NoncentralF-Distribution.html\n        .. [2] Wikipedia, \"Noncentral F-distribution\",\n               https://en.wikipedia.org/wiki/Noncentral_F-distribution\n\n        Examples\n        --------\n        In a study, testing for a specific alternative to the null hypothesis\n        requires use of the Noncentral F distribution. We need to calculate the\n        area in the tail of the distribution that exceeds the value of the F\n        distribution for the null hypothesis.  We'll plot the two probability\n        distributions for comparison.\n\n        >>> dfnum = 3 # between group deg of freedom\n        >>> dfden = 20 # within groups degrees of freedom\n        >>> nonc = 3.0\n        >>> nc_vals = np.random.noncentral_f(dfnum, dfden, nonc, 1000000)\n        >>> NF = np.histogram(nc_vals, bins=50, density=True)\n        >>> c_vals = np.random.f(dfnum, dfden, 1000000)\n        >>> F = np.histogram(c_vals, bins=50, density=True)\n        >>> plt.plot(F[1][1:], F[0])\n        >>> plt.plot(NF[1][1:], NF[0])\n        >>> plt.show()\n\n        ";
+static const char __pyx_k_noncentral_f_dfnum_dfden_nonc_s[] = "\n        noncentral_f(dfnum, dfden, nonc, size=None)\n\n        Draw samples from the noncentral F distribution.\n\n        Samples are drawn from an F distribution with specified parameters,\n        `dfnum` (degrees of freedom in numerator) and `dfden` (degrees of\n        freedom in denominator), where both parameters > 1.\n        `nonc` is the non-centrality parameter.\n\n        Parameters\n        ----------\n        dfnum : float or array_like of floats\n            Numerator degrees of freedom, should be > 0.\n\n            .. versionchanged:: 1.14.0\n               Earlier NumPy versions required dfnum > 1.\n        dfden : float or array_like of floats\n            Denominator degrees of freedom, should be > 0.\n        nonc : float or array_like of floats\n            Non-centrality parameter, the sum of the squares of the numerator\n            means, should be >= 0.\n        size : int or tuple of ints, optional\n            Output shape.  If the given shape is, e.g., ``(m, n, k)``, then\n            ``m * n * k`` samples are drawn.  If size is ``None`` (default),\n            a single value is returned if ``dfnum``, ``dfden``, and ``nonc``\n            are all scalars.  Otherwise, ``np.broadcast(dfnum, dfden, nonc).size``\n            samples are drawn.\n\n        Returns\n        -------\n        out : ndarray or scalar\n            Drawn samples from the parameterized noncentral Fisher distribution.\n\n        Notes\n        -----\n        When calculating the power of an experiment (power = probability of\n        rejecting the null hypothesis when a specific alternative is true) the\n        non-central F statistic becomes important.  When the null hypothesis is\n        true, the F statistic follows a central F distribution. When the null\n        hypothesis is not true, then it follows a non-central F statistic.\n\n        References\n        ----------\n        .. [1] Weisstein, Eric W. \"Noncentral F-Distribution.\"\n               From MathW""orld--A Wolfram Web Resource.\n               http://mathworld.wolfram.com/NoncentralF-Distribution.html\n        .. [2] Wikipedia, \"Noncentral F-distribution\",\n               https://en.wikipedia.org/wiki/Noncentral_F-distribution\n\n        Examples\n        --------\n        In a study, testing for a specific alternative to the null hypothesis\n        requires use of the Noncentral F distribution. We need to calculate the\n        area in the tail of the distribution that exceeds the value of the F\n        distribution for the null hypothesis.  We'll plot the two probability\n        distributions for comparison.\n\n        >>> dfnum = 3 # between group deg of freedom\n        >>> dfden = 20 # within groups degrees of freedom\n        >>> nonc = 3.0\n        >>> nc_vals = np.random.noncentral_f(dfnum, dfden, nonc, 1000000)\n        >>> NF = np.histogram(nc_vals, bins=50, density=True)\n        >>> c_vals = np.random.f(dfnum, dfden, 1000000)\n        >>> F = np.histogram(c_vals, bins=50, density=True)\n        >>> import matplotlib.pyplot as plt\n        >>> plt.plot(F[1][1:], F[0])\n        >>> plt.plot(NF[1][1:], NF[0])\n        >>> plt.show()\n\n        ";
 static const char __pyx_k_normal_loc_0_0_scale_1_0_size_N[] = "\n        normal(loc=0.0, scale=1.0, size=None)\n\n        Draw random samples from a normal (Gaussian) distribution.\n\n        The probability density function of the normal distribution, first\n        derived by De Moivre and 200 years later by both Gauss and Laplace\n        independently [2]_, is often called the bell curve because of\n        its characteristic shape (see the example below).\n\n        The normal distributions occurs often in nature.  For example, it\n        describes the commonly occurring distribution of samples influenced\n        by a large number of tiny, random disturbances, each with its own\n        unique distribution [2]_.\n\n        Parameters\n        ----------\n        loc : float or array_like of floats\n            Mean (\"centre\") of the distribution.\n        scale : float or array_like of floats\n            Standard deviation (spread or \"width\") of the distribution.\n        size : int or tuple of ints, optional\n            Output shape.  If the given shape is, e.g., ``(m, n, k)``, then\n            ``m * n * k`` samples are drawn.  If size is ``None`` (default),\n            a single value is returned if ``loc`` and ``scale`` are both scalars.\n            Otherwise, ``np.broadcast(loc, scale).size`` samples are drawn.\n\n        Returns\n        -------\n        out : ndarray or scalar\n            Drawn samples from the parameterized normal distribution.\n\n        See Also\n        --------\n        scipy.stats.norm : probability density function, distribution or\n            cumulative density function, etc.\n\n        Notes\n        -----\n        The probability density for the Gaussian distribution is\n\n        .. math:: p(x) = \\frac{1}{\\sqrt{ 2 \\pi \\sigma^2 }}\n                         e^{ - \\frac{ (x - \\mu)^2 } {2 \\sigma^2} },\n\n        where :math:`\\mu` is the mean and :math:`\\sigma` the standard\n        deviation. The square of the standard deviation, :math:`\\sigma^2`,\n        is called the v""ariance.\n\n        The function has its peak at the mean, and its \"spread\" increases with\n        the standard deviation (the function reaches 0.607 times its maximum at\n        :math:`x + \\sigma` and :math:`x - \\sigma` [2]_).  This implies that\n        `numpy.random.normal` is more likely to return samples lying close to\n        the mean, rather than those far away.\n\n        References\n        ----------\n        .. [1] Wikipedia, \"Normal distribution\",\n               https://en.wikipedia.org/wiki/Normal_distribution\n        .. [2] P. R. Peebles Jr., \"Central Limit Theorem\" in \"Probability,\n               Random Variables and Random Signal Principles\", 4th ed., 2001,\n               pp. 51, 51, 125.\n\n        Examples\n        --------\n        Draw samples from the distribution:\n\n        >>> mu, sigma = 0, 0.1 # mean and standard deviation\n        >>> s = np.random.normal(mu, sigma, 1000)\n\n        Verify the mean and the variance:\n\n        >>> abs(mu - np.mean(s)) < 0.01\n        True\n\n        >>> abs(sigma - np.std(s, ddof=1)) < 0.01\n        True\n\n        Display the histogram of the samples, along with\n        the probability density function:\n\n        >>> import matplotlib.pyplot as plt\n        >>> count, bins, ignored = plt.hist(s, 30, density=True)\n        >>> plt.plot(bins, 1/(sigma * np.sqrt(2 * np.pi)) *\n        ...                np.exp( - (bins - mu)**2 / (2 * sigma**2) ),\n        ...          linewidth=2, color='r')\n        >>> plt.show()\n\n        ";
 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
 static const char __pyx_k_pareto_a_size_None_Draw_samples[] = "\n        pareto(a, size=None)\n\n        Draw samples from a Pareto II or Lomax distribution with\n        specified shape.\n\n        The Lomax or Pareto II distribution is a shifted Pareto\n        distribution. The classical Pareto distribution can be\n        obtained from the Lomax distribution by adding 1 and\n        multiplying by the scale parameter ``m`` (see Notes).  The\n        smallest value of the Lomax distribution is zero while for the\n        classical Pareto distribution it is ``mu``, where the standard\n        Pareto distribution has location ``mu = 1``.  Lomax can also\n        be considered as a simplified version of the Generalized\n        Pareto distribution (available in SciPy), with the scale set\n        to one and the location set to zero.\n\n        The Pareto distribution must be greater than zero, and is\n        unbounded above.  It is also known as the \"80-20 rule\".  In\n        this distribution, 80 percent of the weights are in the lowest\n        20 percent of the range, while the other 20 percent fill the\n        remaining 80 percent of the range.\n\n        Parameters\n        ----------\n        a : float or array_like of floats\n            Shape of the distribution. Should be greater than zero.\n        size : int or tuple of ints, optional\n            Output shape.  If the given shape is, e.g., ``(m, n, k)``, then\n            ``m * n * k`` samples are drawn.  If size is ``None`` (default),\n            a single value is returned if ``a`` is a scalar.  Otherwise,\n            ``np.array(a).size`` samples are drawn.\n\n        Returns\n        -------\n        out : ndarray or scalar\n            Drawn samples from the parameterized Pareto distribution.\n\n        See Also\n        --------\n        scipy.stats.lomax : probability density function, distribution or\n            cumulative density function, etc.\n        scipy.stats.genpareto : probability density function, distribution or\n            cumulative densit""y function, etc.\n\n        Notes\n        -----\n        The probability density for the Pareto distribution is\n\n        .. math:: p(x) = \\frac{am^a}{x^{a+1}}\n\n        where :math:`a` is the shape and :math:`m` the scale.\n\n        The Pareto distribution, named after the Italian economist\n        Vilfredo Pareto, is a power law probability distribution\n        useful in many real world problems.  Outside the field of\n        economics it is generally referred to as the Bradford\n        distribution. Pareto developed the distribution to describe\n        the distribution of wealth in an economy.  It has also found\n        use in insurance, web page access statistics, oil field sizes,\n        and many other problems, including the download frequency for\n        projects in Sourceforge [1]_.  It is one of the so-called\n        \"fat-tailed\" distributions.\n\n\n        References\n        ----------\n        .. [1] Francis Hunt and Paul Johnson, On the Pareto Distribution of\n               Sourceforge projects.\n        .. [2] Pareto, V. (1896). Course of Political Economy. Lausanne.\n        .. [3] Reiss, R.D., Thomas, M.(2001), Statistical Analysis of Extreme\n               Values, Birkhauser Verlag, Basel, pp 23-30.\n        .. [4] Wikipedia, \"Pareto distribution\",\n               https://en.wikipedia.org/wiki/Pareto_distribution\n\n        Examples\n        --------\n        Draw samples from the distribution:\n\n        >>> a, m = 3., 2.  # shape and mode\n        >>> s = (np.random.pareto(a, 1000) + 1) * m\n\n        Display the histogram of the samples, along with the probability\n        density function:\n\n        >>> import matplotlib.pyplot as plt\n        >>> count, bins, _ = plt.hist(s, 100, density=True)\n        >>> fit = a*m**a / bins**(a+1)\n        >>> plt.plot(bins, max(count)*fit/max(fit), linewidth=2, color='r')\n        >>> plt.show()\n\n        ";
 static const char __pyx_k_power_a_size_None_Draws_samples[] = "\n        power(a, size=None)\n\n        Draws samples in [0, 1] from a power distribution with positive\n        exponent a - 1.\n\n        Also known as the power function distribution.\n\n        Parameters\n        ----------\n        a : float or array_like of floats\n            Parameter of the distribution. Should be greater than zero.\n        size : int or tuple of ints, optional\n            Output shape.  If the given shape is, e.g., ``(m, n, k)``, then\n            ``m * n * k`` samples are drawn.  If size is ``None`` (default),\n            a single value is returned if ``a`` is a scalar.  Otherwise,\n            ``np.array(a).size`` samples are drawn.\n\n        Returns\n        -------\n        out : ndarray or scalar\n            Drawn samples from the parameterized power distribution.\n\n        Raises\n        ------\n        ValueError\n            If a < 1.\n\n        Notes\n        -----\n        The probability density function is\n\n        .. math:: P(x; a) = ax^{a-1}, 0 \\le x \\le 1, a>0.\n\n        The power function distribution is just the inverse of the Pareto\n        distribution. It may also be seen as a special case of the Beta\n        distribution.\n\n        It is used, for example, in modeling the over-reporting of insurance\n        claims.\n\n        References\n        ----------\n        .. [1] Christian Kleiber, Samuel Kotz, \"Statistical size distributions\n               in economics and actuarial sciences\", Wiley, 2003.\n        .. [2] Heckert, N. A. and Filliben, James J. \"NIST Handbook 148:\n               Dataplot Reference Manual, Volume 2: Let Subcommands and Library\n               Functions\", National Institute of Standards and Technology\n               Handbook Series, June 2003.\n               https://www.itl.nist.gov/div898/software/dataplot/refman2/auxillar/powpdf.pdf\n\n        Examples\n        --------\n        Draw samples from the distribution:\n\n        >>> a = 5. # shape\n        >>> samples = 10""00\n        >>> s = np.random.power(a, samples)\n\n        Display the histogram of the samples, along with\n        the probability density function:\n\n        >>> import matplotlib.pyplot as plt\n        >>> count, bins, ignored = plt.hist(s, bins=30)\n        >>> x = np.linspace(0, 1, 100)\n        >>> y = a*x**(a-1.)\n        >>> normed_y = samples*np.diff(bins)[0]*y\n        >>> plt.plot(x, normed_y)\n        >>> plt.show()\n\n        Compare the power function distribution to the inverse of the Pareto.\n\n        >>> from scipy import stats\n        >>> rvs = np.random.power(5, 1000000)\n        >>> rvsp = np.random.pareto(5, 1000000)\n        >>> xx = np.linspace(0,1,100)\n        >>> powpdf = stats.powerlaw.pdf(xx,5)\n\n        >>> plt.figure()\n        >>> plt.hist(rvs, bins=50, density=True)\n        >>> plt.plot(xx,powpdf,'r-')\n        >>> plt.title('np.random.power(5)')\n\n        >>> plt.figure()\n        >>> plt.hist(1./(1.+rvsp), bins=50, density=True)\n        >>> plt.plot(xx,powpdf,'r-')\n        >>> plt.title('inverse of 1 + np.random.pareto(5)')\n\n        >>> plt.figure()\n        >>> plt.hist(1./(1.+rvsp), bins=50, density=True)\n        >>> plt.plot(xx,powpdf,'r-')\n        >>> plt.title('inverse of stats.pareto(5)')\n\n        ";
 static const char __pyx_k_randint_low_high_None_size_None[] = "\n        randint(low, high=None, size=None, dtype='l')\n\n        Return random integers from `low` (inclusive) to `high` (exclusive).\n\n        Return random integers from the \"discrete uniform\" distribution of\n        the specified dtype in the \"half-open\" interval [`low`, `high`). If\n        `high` is None (the default), then results are from [0, `low`).\n\n        Parameters\n        ----------\n        low : int\n            Lowest (signed) integer to be drawn from the distribution (unless\n            ``high=None``, in which case this parameter is one above the\n            *highest* such integer).\n        high : int, optional\n            If provided, one above the largest (signed) integer to be drawn\n            from the distribution (see above for behavior if ``high=None``).\n        size : int or tuple of ints, optional\n            Output shape.  If the given shape is, e.g., ``(m, n, k)``, then\n            ``m * n * k`` samples are drawn.  Default is None, in which case a\n            single value is returned.\n        dtype : dtype, optional\n            Desired dtype of the result. All dtypes are determined by their\n            name, i.e., 'int64', 'int', etc, so byteorder is not available\n            and a specific precision may have different C types depending\n            on the platform. The default value is 'np.int'.\n\n            .. versionadded:: 1.11.0\n\n        Returns\n        -------\n        out : int or ndarray of ints\n            `size`-shaped array of random integers from the appropriate\n            distribution, or a single such random int if `size` not provided.\n\n        See Also\n        --------\n        random.random_integers : similar to `randint`, only for the closed\n            interval [`low`, `high`], and 1 is the lowest value if `high` is\n            omitted. In particular, this other one is the one to use to generate\n            uniformly distributed discrete non-integers.\n\n        Examples\n        ---""-----\n        >>> np.random.randint(2, size=10)\n        array([1, 0, 0, 0, 1, 1, 0, 0, 1, 0])\n        >>> np.random.randint(1, size=10)\n        array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0])\n\n        Generate a 2 x 4 array of ints between 0 and 4, inclusive:\n\n        >>> np.random.randint(5, size=(2, 4))\n        array([[4, 0, 2, 1],\n               [3, 2, 2, 0]])\n\n        ";
 static const char __pyx_k_random_integers_low_high_None_s[] = "\n        random_integers(low, high=None, size=None)\n\n        Random integers of type np.int between `low` and `high`, inclusive.\n\n        Return random integers of type np.int from the \"discrete uniform\"\n        distribution in the closed interval [`low`, `high`].  If `high` is\n        None (the default), then results are from [1, `low`]. The np.int\n        type translates to the C long type used by Python 2 for \"short\"\n        integers and its precision is platform dependent.\n\n        This function has been deprecated. Use randint instead.\n\n        .. deprecated:: 1.11.0\n\n        Parameters\n        ----------\n        low : int\n            Lowest (signed) integer to be drawn from the distribution (unless\n            ``high=None``, in which case this parameter is the *highest* such\n            integer).\n        high : int, optional\n            If provided, the largest (signed) integer to be drawn from the\n            distribution (see above for behavior if ``high=None``).\n        size : int or tuple of ints, optional\n            Output shape.  If the given shape is, e.g., ``(m, n, k)``, then\n            ``m * n * k`` samples are drawn.  Default is None, in which case a\n            single value is returned.\n\n        Returns\n        -------\n        out : int or ndarray of ints\n            `size`-shaped array of random integers from the appropriate\n            distribution, or a single such random int if `size` not provided.\n\n        See Also\n        --------\n        randint : Similar to `random_integers`, only for the half-open\n            interval [`low`, `high`), and 0 is the lowest value if `high` is\n            omitted.\n\n        Notes\n        -----\n        To sample from N evenly spaced floating-point numbers between a and b,\n        use::\n\n          a + (b - a) * (np.random.random_integers(N) - 1) / (N - 1.)\n\n        Examples\n        --------\n        >>> np.random.random_integers(5)\n        4\n        >>> type""(np.random.random_integers(5))\n        <type 'int'>\n        >>> np.random.random_integers(5, size=(3,2))\n        array([[5, 4],\n               [3, 3],\n               [4, 5]])\n\n        Choose five random numbers from the set of five evenly-spaced\n        numbers between 0 and 2.5, inclusive (*i.e.*, from the set\n        :math:`{0, 5/8, 10/8, 15/8, 20/8}`):\n\n        >>> 2.5 * (np.random.random_integers(5, size=(5,)) - 1) / 4.\n        array([ 0.625,  1.25 ,  0.625,  0.625,  2.5  ])\n\n        Roll two six sided dice 1000 times and sum the results:\n\n        >>> d1 = np.random.random_integers(1, 6, 1000)\n        >>> d2 = np.random.random_integers(1, 6, 1000)\n        >>> dsums = d1 + d2\n\n        Display results as a histogram:\n\n        >>> import matplotlib.pyplot as plt\n        >>> count, bins, ignored = plt.hist(dsums, 11, density=True)\n        >>> plt.show()\n\n        ";
-static const char __pyx_k_rayleigh_scale_1_0_size_None_Dr[] = "\n        rayleigh(scale=1.0, size=None)\n\n        Draw samples from a Rayleigh distribution.\n\n        The :math:`\\chi` and Weibull distributions are generalizations of the\n        Rayleigh.\n\n        Parameters\n        ----------\n        scale : float or array_like of floats, optional\n            Scale, also equals the mode. Should be >= 0. Default is 1.\n        size : int or tuple of ints, optional\n            Output shape.  If the given shape is, e.g., ``(m, n, k)``, then\n            ``m * n * k`` samples are drawn.  If size is ``None`` (default),\n            a single value is returned if ``scale`` is a scalar.  Otherwise,\n            ``np.array(scale).size`` samples are drawn.\n\n        Returns\n        -------\n        out : ndarray or scalar\n            Drawn samples from the parameterized Rayleigh distribution.\n\n        Notes\n        -----\n        The probability density function for the Rayleigh distribution is\n\n        .. math:: P(x;scale) = \\frac{x}{scale^2}e^{\\frac{-x^2}{2 \\cdotp scale^2}}\n\n        The Rayleigh distribution would arise, for example, if the East\n        and North components of the wind velocity had identical zero-mean\n        Gaussian distributions.  Then the wind speed would have a Rayleigh\n        distribution.\n\n        References\n        ----------\n        .. [1] Brighton Webs Ltd., \"Rayleigh Distribution,\"\n               https://web.archive.org/web/20090514091424/http://brighton-webs.co.uk:80/distributions/rayleigh.asp\n        .. [2] Wikipedia, \"Rayleigh distribution\"\n               https://en.wikipedia.org/wiki/Rayleigh_distribution\n\n        Examples\n        --------\n        Draw values from the distribution and plot the histogram\n\n        >>> values = hist(np.random.rayleigh(3, 100000), bins=200, density=True)\n\n        Wave heights tend to follow a Rayleigh distribution. If the mean wave\n        height is 1 meter, what fraction of waves are likely to be larger than 3\n        meters?""\n\n        >>> meanvalue = 1\n        >>> modevalue = np.sqrt(2 / np.pi) * meanvalue\n        >>> s = np.random.rayleigh(modevalue, 1000000)\n\n        The percentage of waves larger than 3 meters is:\n\n        >>> 100.*sum(s>3)/1000000.\n        0.087300000000000003\n\n        ";
+static const char __pyx_k_rayleigh_scale_1_0_size_None_Dr[] = "\n        rayleigh(scale=1.0, size=None)\n\n        Draw samples from a Rayleigh distribution.\n\n        The :math:`\\chi` and Weibull distributions are generalizations of the\n        Rayleigh.\n\n        Parameters\n        ----------\n        scale : float or array_like of floats, optional\n            Scale, also equals the mode. Should be >= 0. Default is 1.\n        size : int or tuple of ints, optional\n            Output shape.  If the given shape is, e.g., ``(m, n, k)``, then\n            ``m * n * k`` samples are drawn.  If size is ``None`` (default),\n            a single value is returned if ``scale`` is a scalar.  Otherwise,\n            ``np.array(scale).size`` samples are drawn.\n\n        Returns\n        -------\n        out : ndarray or scalar\n            Drawn samples from the parameterized Rayleigh distribution.\n\n        Notes\n        -----\n        The probability density function for the Rayleigh distribution is\n\n        .. math:: P(x;scale) = \\frac{x}{scale^2}e^{\\frac{-x^2}{2 \\cdotp scale^2}}\n\n        The Rayleigh distribution would arise, for example, if the East\n        and North components of the wind velocity had identical zero-mean\n        Gaussian distributions.  Then the wind speed would have a Rayleigh\n        distribution.\n\n        References\n        ----------\n        .. [1] Brighton Webs Ltd., \"Rayleigh Distribution,\"\n               https://web.archive.org/web/20090514091424/http://brighton-webs.co.uk:80/distributions/rayleigh.asp\n        .. [2] Wikipedia, \"Rayleigh distribution\"\n               https://en.wikipedia.org/wiki/Rayleigh_distribution\n\n        Examples\n        --------\n        Draw values from the distribution and plot the histogram\n\n        >>> from matplotlib.pyplot import hist\n        >>> values = hist(np.random.rayleigh(3, 100000), bins=200, density=True)\n\n        Wave heights tend to follow a Rayleigh distribution. If the mean wave\n        height is 1 meter, what fraction of waves ""are likely to be larger than 3\n        meters?\n\n        >>> meanvalue = 1\n        >>> modevalue = np.sqrt(2 / np.pi) * meanvalue\n        >>> s = np.random.rayleigh(modevalue, 1000000)\n\n        The percentage of waves larger than 3 meters is:\n\n        >>> 100.*sum(s>3)/1000000.\n        0.087300000000000003\n\n        ";
 static const char __pyx_k_standard_t_df_size_None_Draw_sa[] = "\n        standard_t(df, size=None)\n\n        Draw samples from a standard Student's t distribution with `df` degrees\n        of freedom.\n\n        A special case of the hyperbolic distribution.  As `df` gets\n        large, the result resembles that of the standard normal\n        distribution (`standard_normal`).\n\n        Parameters\n        ----------\n        df : float or array_like of floats\n            Degrees of freedom, should be > 0.\n        size : int or tuple of ints, optional\n            Output shape.  If the given shape is, e.g., ``(m, n, k)``, then\n            ``m * n * k`` samples are drawn.  If size is ``None`` (default),\n            a single value is returned if ``df`` is a scalar.  Otherwise,\n            ``np.array(df).size`` samples are drawn.\n\n        Returns\n        -------\n        out : ndarray or scalar\n            Drawn samples from the parameterized standard Student's t distribution.\n\n        Notes\n        -----\n        The probability density function for the t distribution is\n\n        .. math:: P(x, df) = \\frac{\\Gamma(\\frac{df+1}{2})}{\\sqrt{\\pi df}\n                  \\Gamma(\\frac{df}{2})}\\Bigl( 1+\\frac{x^2}{df} \\Bigr)^{-(df+1)/2}\n\n        The t test is based on an assumption that the data come from a\n        Normal distribution. The t test provides a way to test whether\n        the sample mean (that is the mean calculated from the data) is\n        a good estimate of the true mean.\n\n        The derivation of the t-distribution was first published in\n        1908 by William Gosset while working for the Guinness Brewery\n        in Dublin. Due to proprietary issues, he had to publish under\n        a pseudonym, and so he used the name Student.\n\n        References\n        ----------\n        .. [1] Dalgaard, Peter, \"Introductory Statistics With R\",\n               Springer, 2002.\n        .. [2] Wikipedia, \"Student's t-distribution\"\n               https://en.wikipedia.org/wiki/Student's_t-distri""bution\n\n        Examples\n        --------\n        From Dalgaard page 83 [1]_, suppose the daily energy intake for 11\n        women in kilojoules (kJ) is:\n\n        >>> intake = np.array([5260., 5470, 5640, 6180, 6390, 6515, 6805, 7515, \\\n        ...                    7515, 8230, 8770])\n\n        Does their energy intake deviate systematically from the recommended\n        value of 7725 kJ?\n\n        We have 10 degrees of freedom, so is the sample mean within 95% of the\n        recommended value?\n\n        >>> s = np.random.standard_t(10, size=100000)\n        >>> np.mean(intake)\n        6753.636363636364\n        >>> intake.std(ddof=1)\n        1142.1232221373727\n\n        Calculate the t statistic, setting the ddof parameter to the unbiased\n        value so the divisor in the standard deviation will be degrees of\n        freedom, N-1.\n\n        >>> t = (np.mean(intake)-7725)/(intake.std(ddof=1)/np.sqrt(len(intake)))\n        >>> import matplotlib.pyplot as plt\n        >>> h = plt.hist(s, bins=100, density=True)\n\n        For a one-sided t-test, how far out in the distribution does the t\n        statistic appear?\n\n        >>> np.sum(s<t) / float(len(s))\n        0.0090699999999999999  #random\n\n        So the p-value is about 0.009, which says the null hypothesis has a\n        probability of about 99% of being true.\n\n        ";
 static const char __pyx_k_tomaxint_size_None_Random_integ[] = "\n        tomaxint(size=None)\n\n        Random integers between 0 and ``sys.maxint``, inclusive.\n\n        Return a sample of uniformly distributed random integers in the interval\n        [0, ``sys.maxint``].\n\n        Parameters\n        ----------\n        size : int or tuple of ints, optional\n            Output shape.  If the given shape is, e.g., ``(m, n, k)``, then\n            ``m * n * k`` samples are drawn.  Default is None, in which case a\n            single value is returned.\n\n        Returns\n        -------\n        out : ndarray\n            Drawn samples, with shape `size`.\n\n        See Also\n        --------\n        randint : Uniform sampling over a given half-open interval of integers.\n        random_integers : Uniform sampling over a given closed interval of\n            integers.\n\n        Examples\n        --------\n        >>> RS = np.random.mtrand.RandomState() # need a RandomState object\n        >>> RS.tomaxint((2,2,2))\n        array([[[1170048599, 1600360186],\n                [ 739731006, 1947757578]],\n               [[1871712945,  752307660],\n                [1601631370, 1479324245]]])\n        >>> import sys\n        >>> sys.maxint\n        2147483647\n        >>> RS.tomaxint((2,2,2)) < sys.maxint\n        array([[[ True,  True],\n                [ True,  True]],\n               [[ True,  True],\n                [ True,  True]]])\n\n        ";
 static const char __pyx_k_triangular_left_mode_right_size[] = "\n        triangular(left, mode, right, size=None)\n\n        Draw samples from the triangular distribution over the\n        interval ``[left, right]``.\n\n        The triangular distribution is a continuous probability\n        distribution with lower limit left, peak at mode, and upper\n        limit right. Unlike the other distributions, these parameters\n        directly define the shape of the pdf.\n\n        Parameters\n        ----------\n        left : float or array_like of floats\n            Lower limit.\n        mode : float or array_like of floats\n            The value where the peak of the distribution occurs.\n            The value should fulfill the condition ``left <= mode <= right``.\n        right : float or array_like of floats\n            Upper limit, should be larger than `left`.\n        size : int or tuple of ints, optional\n            Output shape.  If the given shape is, e.g., ``(m, n, k)``, then\n            ``m * n * k`` samples are drawn.  If size is ``None`` (default),\n            a single value is returned if ``left``, ``mode``, and ``right``\n            are all scalars.  Otherwise, ``np.broadcast(left, mode, right).size``\n            samples are drawn.\n\n        Returns\n        -------\n        out : ndarray or scalar\n            Drawn samples from the parameterized triangular distribution.\n\n        Notes\n        -----\n        The probability density function for the triangular distribution is\n\n        .. math:: P(x;l, m, r) = \\begin{cases}\n                  \\frac{2(x-l)}{(r-l)(m-l)}& \\text{for $l \\leq x \\leq m$},\\\\\n                  \\frac{2(r-x)}{(r-l)(r-m)}& \\text{for $m \\leq x \\leq r$},\\\\\n                  0& \\text{otherwise}.\n                  \\end{cases}\n\n        The triangular distribution is often used in ill-defined\n        problems where the underlying distribution is not known, but\n        some knowledge of the limits and mode exists. Often it is used\n        in simulations.\n\n       "" References\n        ----------\n        .. [1] Wikipedia, \"Triangular distribution\"\n               https://en.wikipedia.org/wiki/Triangular_distribution\n\n        Examples\n        --------\n        Draw values from the distribution and plot the histogram:\n\n        >>> import matplotlib.pyplot as plt\n        >>> h = plt.hist(np.random.triangular(-3, 0, 8, 100000), bins=200,\n        ...              density=True)\n        >>> plt.show()\n\n        ";
@@ -1909,18 +1910,18 @@ static const char __pyx_k_weibull_a_size_None_Draw_sample[] = "\n        weibull
 static const char __pyx_k_zipf_a_size_None_Draw_samples_f[] = "\n        zipf(a, size=None)\n\n        Draw samples from a Zipf distribution.\n\n        Samples are drawn from a Zipf distribution with specified parameter\n        `a` > 1.\n\n        The Zipf distribution (also known as the zeta distribution) is a\n        continuous probability distribution that satisfies Zipf's law: the\n        frequency of an item is inversely proportional to its rank in a\n        frequency table.\n\n        Parameters\n        ----------\n        a : float or array_like of floats\n            Distribution parameter. Should be greater than 1.\n        size : int or tuple of ints, optional\n            Output shape.  If the given shape is, e.g., ``(m, n, k)``, then\n            ``m * n * k`` samples are drawn.  If size is ``None`` (default),\n            a single value is returned if ``a`` is a scalar. Otherwise,\n            ``np.array(a).size`` samples are drawn.\n\n        Returns\n        -------\n        out : ndarray or scalar\n            Drawn samples from the parameterized Zipf distribution.\n\n        See Also\n        --------\n        scipy.stats.zipf : probability density function, distribution, or\n            cumulative density function, etc.\n\n        Notes\n        -----\n        The probability density for the Zipf distribution is\n\n        .. math:: p(x) = \\frac{x^{-a}}{\\zeta(a)},\n\n        where :math:`\\zeta` is the Riemann Zeta function.\n\n        It is named for the American linguist George Kingsley Zipf, who noted\n        that the frequency of any word in a sample of a language is inversely\n        proportional to its rank in the frequency table.\n\n        References\n        ----------\n        .. [1] Zipf, G. K., \"Selected Studies of the Principle of Relative\n               Frequency in Language,\" Cambridge, MA: Harvard Univ. Press,\n               1932.\n\n        Examples\n        --------\n        Draw samples from the distribution:\n\n        >>> a = 2. # parameter\n        >>> s = np.random.zipf(a, ""1000)\n\n        Display the histogram of the samples, along with\n        the probability density function:\n\n        >>> import matplotlib.pyplot as plt\n        >>> from scipy import special\n\n        Truncate s values at 50 so plot is interesting:\n\n        >>> count, bins, ignored = plt.hist(s[s<50], 50, density=True)\n        >>> x = np.arange(1., 50.)\n        >>> y = x**(-a) / special.zetac(a)\n        >>> plt.plot(x, y/max(y), linewidth=2, color='r')\n        >>> plt.show()\n\n        ";
 static const char __pyx_k_Cannot_take_a_larger_sample_than[] = "Cannot take a larger sample than population when 'replace=False'";
 static const char __pyx_k_Fewer_non_zero_entries_in_p_than[] = "Fewer non-zero entries in p than size";
-static const char __pyx_k_RandomState_multinomial_line_454[] = "RandomState.multinomial (line 4541)";
-static const char __pyx_k_RandomState_negative_binomial_li[] = "RandomState.negative_binomial (line 3812)";
-static const char __pyx_k_RandomState_noncentral_chisquare[] = "RandomState.noncentral_chisquare (line 2285)";
-static const char __pyx_k_RandomState_noncentral_f_line_21[] = "RandomState.noncentral_f (line 2103)";
-static const char __pyx_k_RandomState_permutation_line_486[] = "RandomState.permutation (line 4864)";
-static const char __pyx_k_RandomState_random_integers_line[] = "RandomState.random_integers (line 1421)";
+static const char __pyx_k_RandomState_multinomial_line_455[] = "RandomState.multinomial (line 4550)";
+static const char __pyx_k_RandomState_negative_binomial_li[] = "RandomState.negative_binomial (line 3819)";
+static const char __pyx_k_RandomState_noncentral_chisquare[] = "RandomState.noncentral_chisquare (line 2289)";
+static const char __pyx_k_RandomState_noncentral_f_line_21[] = "RandomState.noncentral_f (line 2106)";
+static const char __pyx_k_RandomState_permutation_line_487[] = "RandomState.permutation (line 4874)";
+static const char __pyx_k_RandomState_random_integers_line[] = "RandomState.random_integers (line 1424)";
 static const char __pyx_k_RandomState_random_sample_line_8[] = "RandomState.random_sample (line 819)";
-static const char __pyx_k_RandomState_standard_cauchy_line[] = "RandomState.standard_cauchy (line 2391)";
-static const char __pyx_k_RandomState_standard_exponential[] = "RandomState.standard_exponential (line 1783)";
-static const char __pyx_k_RandomState_standard_normal_line[] = "RandomState.standard_normal (line 1518)";
-static const char __pyx_k_RandomState_standard_t_line_2455[] = "RandomState.standard_t (line 2455)";
-static const char __pyx_k_RandomState_triangular_line_3602[] = "RandomState.triangular (line 3602)";
+static const char __pyx_k_RandomState_standard_cauchy_line[] = "RandomState.standard_cauchy (line 2395)";
+static const char __pyx_k_RandomState_standard_exponential[] = "RandomState.standard_exponential (line 1786)";
+static const char __pyx_k_RandomState_standard_normal_line[] = "RandomState.standard_normal (line 1521)";
+static const char __pyx_k_RandomState_standard_t_line_2460[] = "RandomState.standard_t (line 2460)";
+static const char __pyx_k_RandomState_triangular_line_3609[] = "RandomState.triangular (line 3609)";
 static const char __pyx_k_Range_cannot_be_empty_low_high_u[] = "Range cannot be empty (low >= high) unless no samples are taken";
 static const char __pyx_k_Seed_values_must_be_between_0_an[] = "Seed values must be between 0 and 2**32 - 1";
 static const char __pyx_k_This_function_is_deprecated_Plea[] = "This function is deprecated. Please call randint(1, {low} + 1) instead";
@@ -1941,50 +1942,50 @@ static PyObject *__pyx_n_s_Lock;
 static PyObject *__pyx_n_s_MT19937;
 static PyObject *__pyx_n_s_OverflowError;
 static PyObject *__pyx_n_s_RandomState;
-static PyObject *__pyx_kp_u_RandomState_binomial_line_3696;
+static PyObject *__pyx_kp_u_RandomState_binomial_line_3703;
 static PyObject *__pyx_kp_u_RandomState_bytes_line_1003;
-static PyObject *__pyx_kp_u_RandomState_chisquare_line_2204;
+static PyObject *__pyx_kp_u_RandomState_chisquare_line_2208;
 static PyObject *__pyx_kp_u_RandomState_choice_line_1032;
 static PyObject *__pyx_n_s_RandomState_ctor;
-static PyObject *__pyx_kp_u_RandomState_dirichlet_line_4654;
-static PyObject *__pyx_kp_u_RandomState_f_line_1996;
-static PyObject *__pyx_kp_u_RandomState_gamma_line_1900;
-static PyObject *__pyx_kp_u_RandomState_geometric_line_4092;
-static PyObject *__pyx_kp_u_RandomState_gumbel_line_3088;
+static PyObject *__pyx_kp_u_RandomState_dirichlet_line_4663;
+static PyObject *__pyx_kp_u_RandomState_f_line_1999;
+static PyObject *__pyx_kp_u_RandomState_gamma_line_1903;
+static PyObject *__pyx_kp_u_RandomState_geometric_line_4099;
+static PyObject *__pyx_kp_u_RandomState_gumbel_line_3093;
 static PyObject *__pyx_kp_u_RandomState_hypergeometric_line;
-static PyObject *__pyx_kp_u_RandomState_laplace_line_2990;
-static PyObject *__pyx_kp_u_RandomState_logistic_line_3219;
-static PyObject *__pyx_kp_u_RandomState_lognormal_line_3312;
-static PyObject *__pyx_kp_u_RandomState_logseries_line_4282;
-static PyObject *__pyx_kp_u_RandomState_multinomial_line_454;
+static PyObject *__pyx_kp_u_RandomState_laplace_line_2995;
+static PyObject *__pyx_kp_u_RandomState_logistic_line_3224;
+static PyObject *__pyx_kp_u_RandomState_lognormal_line_3318;
+static PyObject *__pyx_kp_u_RandomState_logseries_line_4290;
+static PyObject *__pyx_kp_u_RandomState_multinomial_line_455;
 static PyObject *__pyx_kp_u_RandomState_multivariate_normal;
 static PyObject *__pyx_kp_u_RandomState_negative_binomial_li;
 static PyObject *__pyx_kp_u_RandomState_noncentral_chisquare;
 static PyObject *__pyx_kp_u_RandomState_noncentral_f_line_21;
-static PyObject *__pyx_kp_u_RandomState_normal_line_1551;
-static PyObject *__pyx_kp_u_RandomState_pareto_line_2659;
-static PyObject *__pyx_kp_u_RandomState_permutation_line_486;
-static PyObject *__pyx_kp_u_RandomState_poisson_line_3911;
-static PyObject *__pyx_kp_u_RandomState_power_line_2879;
-static PyObject *__pyx_kp_u_RandomState_rand_line_1320;
+static PyObject *__pyx_kp_u_RandomState_normal_line_1554;
+static PyObject *__pyx_kp_u_RandomState_pareto_line_2664;
+static PyObject *__pyx_kp_u_RandomState_permutation_line_487;
+static PyObject *__pyx_kp_u_RandomState_poisson_line_3918;
+static PyObject *__pyx_kp_u_RandomState_power_line_2884;
+static PyObject *__pyx_kp_u_RandomState_rand_line_1323;
 static PyObject *__pyx_kp_u_RandomState_randint_line_910;
-static PyObject *__pyx_kp_u_RandomState_randn_line_1364;
+static PyObject *__pyx_kp_u_RandomState_randn_line_1367;
 static PyObject *__pyx_kp_u_RandomState_random_integers_line;
 static PyObject *__pyx_kp_u_RandomState_random_sample_line_8;
-static PyObject *__pyx_kp_u_RandomState_rayleigh_line_3436;
-static PyObject *__pyx_kp_u_RandomState_shuffle_line_4777;
+static PyObject *__pyx_kp_u_RandomState_rayleigh_line_3442;
+static PyObject *__pyx_kp_u_RandomState_shuffle_line_4787;
 static PyObject *__pyx_kp_u_RandomState_standard_cauchy_line;
 static PyObject *__pyx_kp_u_RandomState_standard_exponential;
 static PyObject *__pyx_kp_u_RandomState_standard_gamma_line;
 static PyObject *__pyx_kp_u_RandomState_standard_normal_line;
-static PyObject *__pyx_kp_u_RandomState_standard_t_line_2455;
+static PyObject *__pyx_kp_u_RandomState_standard_t_line_2460;
 static PyObject *__pyx_kp_u_RandomState_tomaxint_line_863;
-static PyObject *__pyx_kp_u_RandomState_triangular_line_3602;
-static PyObject *__pyx_kp_u_RandomState_uniform_line_1214;
-static PyObject *__pyx_kp_u_RandomState_vonmises_line_2561;
-static PyObject *__pyx_kp_u_RandomState_wald_line_3515;
-static PyObject *__pyx_kp_u_RandomState_weibull_line_2769;
-static PyObject *__pyx_kp_u_RandomState_zipf_line_3999;
+static PyObject *__pyx_kp_u_RandomState_triangular_line_3609;
+static PyObject *__pyx_kp_u_RandomState_uniform_line_1217;
+static PyObject *__pyx_kp_u_RandomState_vonmises_line_2566;
+static PyObject *__pyx_kp_u_RandomState_wald_line_3522;
+static PyObject *__pyx_kp_u_RandomState_weibull_line_2774;
+static PyObject *__pyx_kp_u_RandomState_zipf_line_4006;
 static PyObject *__pyx_kp_s_Range_cannot_be_empty_low_high_u;
 static PyObject *__pyx_kp_s_Range_exceeds_valid_bounds;
 static PyObject *__pyx_n_s_RuntimeWarning;
@@ -2192,6 +2193,7 @@ static PyObject *__pyx_n_s_poisson_lam_max;
 static PyObject *__pyx_n_s_power;
 static PyObject *__pyx_kp_u_power_a_size_None_Draws_samples;
 static PyObject *__pyx_kp_s_probabilities_are_not_non_negati;
+static PyObject *__pyx_kp_s_probabilities_contain_NaN;
 static PyObject *__pyx_kp_s_probabilities_do_not_sum_to_1;
 static PyObject *__pyx_n_s_prod;
 static PyObject *__pyx_n_s_pvals;
@@ -2398,7 +2400,7 @@ static PyObject *__pyx_tuple__8;
 static PyObject *__pyx_tuple__9;
 static PyObject *__pyx_slice__10;
 static PyObject *__pyx_slice__11;
-static PyObject *__pyx_slice__67;
+static PyObject *__pyx_slice__68;
 static PyObject *__pyx_tuple__12;
 static PyObject *__pyx_tuple__14;
 static PyObject *__pyx_tuple__15;
@@ -2453,7 +2455,7 @@ static PyObject *__pyx_tuple__63;
 static PyObject *__pyx_tuple__64;
 static PyObject *__pyx_tuple__65;
 static PyObject *__pyx_tuple__66;
-static PyObject *__pyx_tuple__68;
+static PyObject *__pyx_tuple__67;
 static PyObject *__pyx_tuple__69;
 static PyObject *__pyx_tuple__70;
 static PyObject *__pyx_tuple__71;
@@ -2461,25 +2463,26 @@ static PyObject *__pyx_tuple__72;
 static PyObject *__pyx_tuple__73;
 static PyObject *__pyx_tuple__74;
 static PyObject *__pyx_tuple__75;
-static PyObject *__pyx_tuple__77;
-static PyObject *__pyx_tuple__79;
-static PyObject *__pyx_tuple__81;
-static PyObject *__pyx_tuple__83;
-static PyObject *__pyx_tuple__85;
-static PyObject *__pyx_tuple__87;
-static PyObject *__pyx_tuple__89;
-static PyObject *__pyx_tuple__91;
-static PyObject *__pyx_tuple__93;
-static PyObject *__pyx_codeobj__76;
-static PyObject *__pyx_codeobj__78;
-static PyObject *__pyx_codeobj__80;
-static PyObject *__pyx_codeobj__82;
-static PyObject *__pyx_codeobj__84;
-static PyObject *__pyx_codeobj__86;
-static PyObject *__pyx_codeobj__88;
-static PyObject *__pyx_codeobj__90;
-static PyObject *__pyx_codeobj__92;
-static PyObject *__pyx_codeobj__94;
+static PyObject *__pyx_tuple__76;
+static PyObject *__pyx_tuple__78;
+static PyObject *__pyx_tuple__80;
+static PyObject *__pyx_tuple__82;
+static PyObject *__pyx_tuple__84;
+static PyObject *__pyx_tuple__86;
+static PyObject *__pyx_tuple__88;
+static PyObject *__pyx_tuple__90;
+static PyObject *__pyx_tuple__92;
+static PyObject *__pyx_tuple__94;
+static PyObject *__pyx_codeobj__77;
+static PyObject *__pyx_codeobj__79;
+static PyObject *__pyx_codeobj__81;
+static PyObject *__pyx_codeobj__83;
+static PyObject *__pyx_codeobj__85;
+static PyObject *__pyx_codeobj__87;
+static PyObject *__pyx_codeobj__89;
+static PyObject *__pyx_codeobj__91;
+static PyObject *__pyx_codeobj__93;
+static PyObject *__pyx_codeobj__95;
 /* Late includes */
 
 /* "numpy.pxd":158
@@ -16761,9 +16764,10 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_25choice(PyObject *__pyx_v_self,
 
 static PyObject *__pyx_pf_6mtrand_11RandomState_24choice(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_a, PyObject *__pyx_v_size, PyObject *__pyx_v_replace, PyObject *__pyx_v_p) {
   PyObject *__pyx_v_pop_size = NULL;
-  PyObject *__pyx_v_d = NULL;
+  Py_ssize_t __pyx_v_d;
   PyObject *__pyx_v_atol = NULL;
   double *__pyx_v_pix;
+  double __pyx_v_p_sum;
   PyObject *__pyx_v_shape = NULL;
   PyObject *__pyx_v_cdf = NULL;
   PyObject *__pyx_v_uniform_samples = NULL;
@@ -16792,8 +16796,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_24choice(struct __pyx_obj_6mtran
   int __pyx_t_12;
   Py_ssize_t __pyx_t_13;
   PyObject *__pyx_t_14 = NULL;
-  npy_intp __pyx_t_15;
-  PyObject *(*__pyx_t_16)(PyObject *);
+  PyObject *(*__pyx_t_15)(PyObject *);
   __Pyx_RefNannySetupContext("choice", 0);
   __Pyx_INCREF(__pyx_v_a);
   __Pyx_INCREF(__pyx_v_size);
@@ -17188,10 +17191,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_24choice(struct __pyx_obj_6mtran
  *             atol = np.sqrt(np.finfo(np.float64).eps)
  */
     __pyx_t_13 = PyObject_Length(__pyx_v_p); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1128, __pyx_L1_error)
-    __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1128, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_v_d = __pyx_t_1;
-    __pyx_t_1 = 0;
+    __pyx_v_d = __pyx_t_13;
 
     /* "mtrand.pyx":1130
  *             d = len(p)
@@ -17502,7 +17502,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_24choice(struct __pyx_obj_6mtran
  *                 raise ValueError("'p' must be 1-dimensional")
  *             if p.size != pop_size:             # <<<<<<<<<<<<<<
  *                 raise ValueError("'a' and 'p' must have same size")
- *             if np.logical_or.reduce(p < 0):
+ *             p_sum = kahan_sum(pix, d)
  */
     __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_p, __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1140, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
@@ -17516,8 +17516,8 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_24choice(struct __pyx_obj_6mtran
  *                 raise ValueError("'p' must be 1-dimensional")
  *             if p.size != pop_size:
  *                 raise ValueError("'a' and 'p' must have same size")             # <<<<<<<<<<<<<<
- *             if np.logical_or.reduce(p < 0):
- *                 raise ValueError("probabilities are not non-negative")
+ *             p_sum = kahan_sum(pix, d)
+ *             if np.isnan(p_sum):
  */
       __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1141, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
@@ -17530,101 +17530,165 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_24choice(struct __pyx_obj_6mtran
  *                 raise ValueError("'p' must be 1-dimensional")
  *             if p.size != pop_size:             # <<<<<<<<<<<<<<
  *                 raise ValueError("'a' and 'p' must have same size")
- *             if np.logical_or.reduce(p < 0):
+ *             p_sum = kahan_sum(pix, d)
  */
     }
 
     /* "mtrand.pyx":1142
  *             if p.size != pop_size:
  *                 raise ValueError("'a' and 'p' must have same size")
- *             if np.logical_or.reduce(p < 0):             # <<<<<<<<<<<<<<
- *                 raise ValueError("probabilities are not non-negative")
- *             if abs(kahan_sum(pix, d) - 1.) > atol:
+ *             p_sum = kahan_sum(pix, d)             # <<<<<<<<<<<<<<
+ *             if np.isnan(p_sum):
+ *                 raise ValueError("probabilities contain NaN")
  */
-    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1142, __pyx_L1_error)
+    __pyx_v_p_sum = __pyx_f_6mtrand_kahan_sum(__pyx_v_pix, __pyx_v_d);
+
+    /* "mtrand.pyx":1143
+ *                 raise ValueError("'a' and 'p' must have same size")
+ *             p_sum = kahan_sum(pix, d)
+ *             if np.isnan(p_sum):             # <<<<<<<<<<<<<<
+ *                 raise ValueError("probabilities contain NaN")
+ *             if np.logical_or.reduce(p < 0):
+ */
+    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1143, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_logical_or); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1142, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_isnan); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1143, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_reduce); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1142, __pyx_L1_error)
+    __pyx_t_4 = PyFloat_FromDouble(__pyx_v_p_sum); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1143, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_2 = PyObject_RichCompare(__pyx_v_p, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1142, __pyx_L1_error)
     __pyx_t_9 = NULL;
-    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
-      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2);
       if (likely(__pyx_t_9)) {
-        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
         __Pyx_INCREF(__pyx_t_9);
         __Pyx_INCREF(function);
-        __Pyx_DECREF_SET(__pyx_t_4, function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
       }
     }
-    __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_9, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2);
+    __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_9, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1142, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1142, __pyx_L1_error)
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1143, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1143, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     if (unlikely(__pyx_t_5)) {
 
+      /* "mtrand.pyx":1144
+ *             p_sum = kahan_sum(pix, d)
+ *             if np.isnan(p_sum):
+ *                 raise ValueError("probabilities contain NaN")             # <<<<<<<<<<<<<<
+ *             if np.logical_or.reduce(p < 0):
+ *                 raise ValueError("probabilities are not non-negative")
+ */
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1144, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __PYX_ERR(0, 1144, __pyx_L1_error)
+
       /* "mtrand.pyx":1143
  *                 raise ValueError("'a' and 'p' must have same size")
+ *             p_sum = kahan_sum(pix, d)
+ *             if np.isnan(p_sum):             # <<<<<<<<<<<<<<
+ *                 raise ValueError("probabilities contain NaN")
+ *             if np.logical_or.reduce(p < 0):
+ */
+    }
+
+    /* "mtrand.pyx":1145
+ *             if np.isnan(p_sum):
+ *                 raise ValueError("probabilities contain NaN")
+ *             if np.logical_or.reduce(p < 0):             # <<<<<<<<<<<<<<
+ *                 raise ValueError("probabilities are not non-negative")
+ *             if abs(p_sum - 1.) > atol:
+ */
+    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1145, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_logical_or); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1145, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_reduce); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1145, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_4 = PyObject_RichCompare(__pyx_v_p, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1145, __pyx_L1_error)
+    __pyx_t_9 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_9)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_9);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+      }
+    }
+    __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_9, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
+    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1145, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1145, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    if (unlikely(__pyx_t_5)) {
+
+      /* "mtrand.pyx":1146
+ *                 raise ValueError("probabilities contain NaN")
  *             if np.logical_or.reduce(p < 0):
  *                 raise ValueError("probabilities are not non-negative")             # <<<<<<<<<<<<<<
- *             if abs(kahan_sum(pix, d) - 1.) > atol:
+ *             if abs(p_sum - 1.) > atol:
  *                 raise ValueError("probabilities do not sum to 1")
  */
-      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1143, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1146, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_Raise(__pyx_t_1, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __PYX_ERR(0, 1143, __pyx_L1_error)
+      __PYX_ERR(0, 1146, __pyx_L1_error)
 
-      /* "mtrand.pyx":1142
- *             if p.size != pop_size:
- *                 raise ValueError("'a' and 'p' must have same size")
+      /* "mtrand.pyx":1145
+ *             if np.isnan(p_sum):
+ *                 raise ValueError("probabilities contain NaN")
  *             if np.logical_or.reduce(p < 0):             # <<<<<<<<<<<<<<
  *                 raise ValueError("probabilities are not non-negative")
- *             if abs(kahan_sum(pix, d) - 1.) > atol:
+ *             if abs(p_sum - 1.) > atol:
  */
     }
 
-    /* "mtrand.pyx":1144
+    /* "mtrand.pyx":1147
  *             if np.logical_or.reduce(p < 0):
  *                 raise ValueError("probabilities are not non-negative")
- *             if abs(kahan_sum(pix, d) - 1.) > atol:             # <<<<<<<<<<<<<<
+ *             if abs(p_sum - 1.) > atol:             # <<<<<<<<<<<<<<
  *                 raise ValueError("probabilities do not sum to 1")
  * 
  */
-    __pyx_t_15 = __Pyx_PyInt_As_npy_intp(__pyx_v_d); if (unlikely((__pyx_t_15 == ((npy_intp)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1144, __pyx_L1_error)
-    __pyx_t_1 = PyFloat_FromDouble(fabs((__pyx_f_6mtrand_kahan_sum(__pyx_v_pix, __pyx_t_15) - 1.))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1144, __pyx_L1_error)
+    __pyx_t_1 = PyFloat_FromDouble(fabs((__pyx_v_p_sum - 1.))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1147, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_v_atol, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1144, __pyx_L1_error)
+    __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_v_atol, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1147, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1144, __pyx_L1_error)
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1147, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     if (unlikely(__pyx_t_5)) {
 
-      /* "mtrand.pyx":1145
+      /* "mtrand.pyx":1148
  *                 raise ValueError("probabilities are not non-negative")
- *             if abs(kahan_sum(pix, d) - 1.) > atol:
+ *             if abs(p_sum - 1.) > atol:
  *                 raise ValueError("probabilities do not sum to 1")             # <<<<<<<<<<<<<<
  * 
  *         shape = size
  */
-      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1145, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_4);
-      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __PYX_ERR(0, 1145, __pyx_L1_error)
+      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1148, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __PYX_ERR(0, 1148, __pyx_L1_error)
 
-      /* "mtrand.pyx":1144
+      /* "mtrand.pyx":1147
  *             if np.logical_or.reduce(p < 0):
  *                 raise ValueError("probabilities are not non-negative")
- *             if abs(kahan_sum(pix, d) - 1.) > atol:             # <<<<<<<<<<<<<<
+ *             if abs(p_sum - 1.) > atol:             # <<<<<<<<<<<<<<
  *                 raise ValueError("probabilities do not sum to 1")
  * 
  */
@@ -17639,7 +17703,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_24choice(struct __pyx_obj_6mtran
  */
   }
 
-  /* "mtrand.pyx":1147
+  /* "mtrand.pyx":1150
  *                 raise ValueError("probabilities do not sum to 1")
  * 
  *         shape = size             # <<<<<<<<<<<<<<
@@ -17649,7 +17713,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_24choice(struct __pyx_obj_6mtran
   __Pyx_INCREF(__pyx_v_size);
   __pyx_v_shape = __pyx_v_size;
 
-  /* "mtrand.pyx":1148
+  /* "mtrand.pyx":1151
  * 
  *         shape = size
  *         if shape is not None:             # <<<<<<<<<<<<<<
@@ -17660,51 +17724,51 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_24choice(struct __pyx_obj_6mtran
   __pyx_t_12 = (__pyx_t_5 != 0);
   if (__pyx_t_12) {
 
-    /* "mtrand.pyx":1149
+    /* "mtrand.pyx":1152
  *         shape = size
  *         if shape is not None:
  *             size = np.prod(shape, dtype=np.intp)             # <<<<<<<<<<<<<<
  *         else:
  *             size = 1
  */
-    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1149, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_prod); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1149, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1152, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_prod); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1152, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1149, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1152, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
     __Pyx_INCREF(__pyx_v_shape);
     __Pyx_GIVEREF(__pyx_v_shape);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape);
-    __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1149, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1149, __pyx_L1_error)
+    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
+    __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1152, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1152, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_9);
-    __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_intp); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1149, __pyx_L1_error)
+    __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_intp); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1152, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_14);
     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_14) < 0) __PYX_ERR(0, 1149, __pyx_L1_error)
+    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_14) < 0) __PYX_ERR(0, 1152, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
-    __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1149, __pyx_L1_error)
+    __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1152, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_14);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_DECREF_SET(__pyx_v_size, __pyx_t_14);
     __pyx_t_14 = 0;
 
-    /* "mtrand.pyx":1148
+    /* "mtrand.pyx":1151
  * 
  *         shape = size
  *         if shape is not None:             # <<<<<<<<<<<<<<
  *             size = np.prod(shape, dtype=np.intp)
  *         else:
  */
-    goto __pyx_L25;
+    goto __pyx_L26;
   }
 
-  /* "mtrand.pyx":1151
+  /* "mtrand.pyx":1154
  *             size = np.prod(shape, dtype=np.intp)
  *         else:
  *             size = 1             # <<<<<<<<<<<<<<
@@ -17715,19 +17779,19 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_24choice(struct __pyx_obj_6mtran
     __Pyx_INCREF(__pyx_int_1);
     __Pyx_DECREF_SET(__pyx_v_size, __pyx_int_1);
   }
-  __pyx_L25:;
+  __pyx_L26:;
 
-  /* "mtrand.pyx":1154
+  /* "mtrand.pyx":1157
  * 
  *         # Actual sampling
  *         if replace:             # <<<<<<<<<<<<<<
  *             if p is not None:
  *                 cdf = p.cumsum()
  */
-  __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_replace); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 1154, __pyx_L1_error)
+  __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_replace); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 1157, __pyx_L1_error)
   if (__pyx_t_12) {
 
-    /* "mtrand.pyx":1155
+    /* "mtrand.pyx":1158
  *         # Actual sampling
  *         if replace:
  *             if p is not None:             # <<<<<<<<<<<<<<
@@ -17738,139 +17802,139 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_24choice(struct __pyx_obj_6mtran
     __pyx_t_5 = (__pyx_t_12 != 0);
     if (__pyx_t_5) {
 
-      /* "mtrand.pyx":1156
+      /* "mtrand.pyx":1159
  *         if replace:
  *             if p is not None:
  *                 cdf = p.cumsum()             # <<<<<<<<<<<<<<
  *                 cdf /= cdf[-1]
  *                 uniform_samples = self.random_sample(shape)
  */
-      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_p, __pyx_n_s_cumsum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1156, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_4 = NULL;
-      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
-        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
-        if (likely(__pyx_t_4)) {
-          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
-          __Pyx_INCREF(__pyx_t_4);
+      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_p, __pyx_n_s_cumsum); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1159, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_2 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
+        if (likely(__pyx_t_2)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+          __Pyx_INCREF(__pyx_t_2);
           __Pyx_INCREF(function);
-          __Pyx_DECREF_SET(__pyx_t_2, function);
+          __Pyx_DECREF_SET(__pyx_t_4, function);
         }
       }
-      __pyx_t_14 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
-      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-      if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1156, __pyx_L1_error)
+      __pyx_t_14 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1159, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_14);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       __pyx_v_cdf = __pyx_t_14;
       __pyx_t_14 = 0;
 
-      /* "mtrand.pyx":1157
+      /* "mtrand.pyx":1160
  *             if p is not None:
  *                 cdf = p.cumsum()
  *                 cdf /= cdf[-1]             # <<<<<<<<<<<<<<
  *                 uniform_samples = self.random_sample(shape)
  *                 idx = cdf.searchsorted(uniform_samples, side='right')
  */
-      __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_cdf, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1157, __pyx_L1_error)
+      __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_cdf, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1160, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_14);
-      __pyx_t_2 = __Pyx_PyNumber_InPlaceDivide(__pyx_v_cdf, __pyx_t_14); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1157, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_4 = __Pyx_PyNumber_InPlaceDivide(__pyx_v_cdf, __pyx_t_14); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1160, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_4);
       __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
-      __Pyx_DECREF_SET(__pyx_v_cdf, __pyx_t_2);
-      __pyx_t_2 = 0;
+      __Pyx_DECREF_SET(__pyx_v_cdf, __pyx_t_4);
+      __pyx_t_4 = 0;
 
-      /* "mtrand.pyx":1158
+      /* "mtrand.pyx":1161
  *                 cdf = p.cumsum()
  *                 cdf /= cdf[-1]
  *                 uniform_samples = self.random_sample(shape)             # <<<<<<<<<<<<<<
  *                 idx = cdf.searchsorted(uniform_samples, side='right')
  *                 idx = np.array(idx, copy=False) # searchsorted returns a scalar
  */
-      __pyx_t_14 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_random_sample); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1158, __pyx_L1_error)
+      __pyx_t_14 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_random_sample); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1161, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_14);
-      __pyx_t_4 = NULL;
+      __pyx_t_2 = NULL;
       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) {
-        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_14);
-        if (likely(__pyx_t_4)) {
+        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_14);
+        if (likely(__pyx_t_2)) {
           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
-          __Pyx_INCREF(__pyx_t_4);
+          __Pyx_INCREF(__pyx_t_2);
           __Pyx_INCREF(function);
           __Pyx_DECREF_SET(__pyx_t_14, function);
         }
       }
-      __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_4, __pyx_v_shape) : __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_v_shape);
-      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1158, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_2, __pyx_v_shape) : __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_v_shape);
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1161, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_4);
       __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
-      __pyx_v_uniform_samples = __pyx_t_2;
-      __pyx_t_2 = 0;
+      __pyx_v_uniform_samples = __pyx_t_4;
+      __pyx_t_4 = 0;
 
-      /* "mtrand.pyx":1159
+      /* "mtrand.pyx":1162
  *                 cdf /= cdf[-1]
  *                 uniform_samples = self.random_sample(shape)
  *                 idx = cdf.searchsorted(uniform_samples, side='right')             # <<<<<<<<<<<<<<
  *                 idx = np.array(idx, copy=False) # searchsorted returns a scalar
  *             else:
  */
-      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cdf, __pyx_n_s_searchsorted); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1159, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1159, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_cdf, __pyx_n_s_searchsorted); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1162, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1162, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_14);
       __Pyx_INCREF(__pyx_v_uniform_samples);
       __Pyx_GIVEREF(__pyx_v_uniform_samples);
       PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v_uniform_samples);
-      __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1159, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_4);
-      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_side, __pyx_n_s_right) < 0) __PYX_ERR(0, 1159, __pyx_L1_error)
-      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_14, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1159, __pyx_L1_error)
+      __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1162, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_side, __pyx_n_s_right) < 0) __PYX_ERR(0, 1162, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_14, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1162, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       __pyx_v_idx = __pyx_t_1;
       __pyx_t_1 = 0;
 
-      /* "mtrand.pyx":1160
+      /* "mtrand.pyx":1163
  *                 uniform_samples = self.random_sample(shape)
  *                 idx = cdf.searchsorted(uniform_samples, side='right')
  *                 idx = np.array(idx, copy=False) # searchsorted returns a scalar             # <<<<<<<<<<<<<<
  *             else:
  *                 idx = self.randint(0, pop_size, size=shape)
  */
-      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1160, __pyx_L1_error)
+      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1163, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1160, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1163, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1160, __pyx_L1_error)
+      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1163, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_INCREF(__pyx_v_idx);
       __Pyx_GIVEREF(__pyx_v_idx);
       PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_idx);
-      __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1160, __pyx_L1_error)
+      __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1163, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_14);
-      if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 1160, __pyx_L1_error)
-      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, __pyx_t_14); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1160, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 1163, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_14); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1163, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
       __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
-      __Pyx_DECREF_SET(__pyx_v_idx, __pyx_t_2);
-      __pyx_t_2 = 0;
+      __Pyx_DECREF_SET(__pyx_v_idx, __pyx_t_4);
+      __pyx_t_4 = 0;
 
-      /* "mtrand.pyx":1155
+      /* "mtrand.pyx":1158
  *         # Actual sampling
  *         if replace:
  *             if p is not None:             # <<<<<<<<<<<<<<
  *                 cdf = p.cumsum()
  *                 cdf /= cdf[-1]
  */
-      goto __pyx_L27;
+      goto __pyx_L28;
     }
 
-    /* "mtrand.pyx":1162
+    /* "mtrand.pyx":1165
  *                 idx = np.array(idx, copy=False) # searchsorted returns a scalar
  *             else:
  *                 idx = self.randint(0, pop_size, size=shape)             # <<<<<<<<<<<<<<
@@ -17878,9 +17942,9 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_24choice(struct __pyx_obj_6mtran
  *             if size > pop_size:
  */
     /*else*/ {
-      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_randint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1162, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1162, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_randint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1165, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1165, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_14);
       __Pyx_INCREF(__pyx_int_0);
       __Pyx_GIVEREF(__pyx_int_0);
@@ -17888,30 +17952,30 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_24choice(struct __pyx_obj_6mtran
       __Pyx_INCREF(__pyx_v_pop_size);
       __Pyx_GIVEREF(__pyx_v_pop_size);
       PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_v_pop_size);
-      __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1162, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1165, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
-      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_size, __pyx_v_shape) < 0) __PYX_ERR(0, 1162, __pyx_L1_error)
-      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_14, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1162, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_4);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_size, __pyx_v_shape) < 0) __PYX_ERR(0, 1165, __pyx_L1_error)
+      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_14, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1165, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __pyx_v_idx = __pyx_t_4;
-      __pyx_t_4 = 0;
+      __pyx_v_idx = __pyx_t_2;
+      __pyx_t_2 = 0;
     }
-    __pyx_L27:;
+    __pyx_L28:;
 
-    /* "mtrand.pyx":1154
+    /* "mtrand.pyx":1157
  * 
  *         # Actual sampling
  *         if replace:             # <<<<<<<<<<<<<<
  *             if p is not None:
  *                 cdf = p.cumsum()
  */
-    goto __pyx_L26;
+    goto __pyx_L27;
   }
 
-  /* "mtrand.pyx":1164
+  /* "mtrand.pyx":1167
  *                 idx = self.randint(0, pop_size, size=shape)
  *         else:
  *             if size > pop_size:             # <<<<<<<<<<<<<<
@@ -17919,25 +17983,25 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_24choice(struct __pyx_obj_6mtran
  *                                  "population when 'replace=False'")
  */
   /*else*/ {
-    __pyx_t_4 = PyObject_RichCompare(__pyx_v_size, __pyx_v_pop_size, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1164, __pyx_L1_error)
-    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1164, __pyx_L1_error)
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_2 = PyObject_RichCompare(__pyx_v_size, __pyx_v_pop_size, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1167, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1167, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     if (unlikely(__pyx_t_5)) {
 
-      /* "mtrand.pyx":1165
+      /* "mtrand.pyx":1168
  *         else:
  *             if size > pop_size:
  *                 raise ValueError("Cannot take a larger sample than "             # <<<<<<<<<<<<<<
  *                                  "population when 'replace=False'")
  * 
  */
-      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1165, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_4);
-      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __PYX_ERR(0, 1165, __pyx_L1_error)
+      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1168, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __PYX_ERR(0, 1168, __pyx_L1_error)
 
-      /* "mtrand.pyx":1164
+      /* "mtrand.pyx":1167
  *                 idx = self.randint(0, pop_size, size=shape)
  *         else:
  *             if size > pop_size:             # <<<<<<<<<<<<<<
@@ -17946,7 +18010,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_24choice(struct __pyx_obj_6mtran
  */
     }
 
-    /* "mtrand.pyx":1168
+    /* "mtrand.pyx":1171
  *                                  "population when 'replace=False'")
  * 
  *             if p is not None:             # <<<<<<<<<<<<<<
@@ -17957,55 +18021,55 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_24choice(struct __pyx_obj_6mtran
     __pyx_t_12 = (__pyx_t_5 != 0);
     if (__pyx_t_12) {
 
-      /* "mtrand.pyx":1169
+      /* "mtrand.pyx":1172
  * 
  *             if p is not None:
  *                 if np.count_nonzero(p > 0) < size:             # <<<<<<<<<<<<<<
  *                     raise ValueError("Fewer non-zero entries in p than size")
  *                 n_uniq = 0
  */
-      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1169, __pyx_L1_error)
+      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1172, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_count_nonzero); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1169, __pyx_L1_error)
+      __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_count_nonzero); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1172, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_14);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __pyx_t_1 = PyObject_RichCompare(__pyx_v_p, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1169, __pyx_L1_error)
-      __pyx_t_2 = NULL;
+      __pyx_t_1 = PyObject_RichCompare(__pyx_v_p, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1172, __pyx_L1_error)
+      __pyx_t_4 = NULL;
       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) {
-        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_14);
-        if (likely(__pyx_t_2)) {
+        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_14);
+        if (likely(__pyx_t_4)) {
           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
-          __Pyx_INCREF(__pyx_t_2);
+          __Pyx_INCREF(__pyx_t_4);
           __Pyx_INCREF(function);
           __Pyx_DECREF_SET(__pyx_t_14, function);
         }
       }
-      __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_2, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_1);
-      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_4, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_1);
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1169, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_4);
+      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1172, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
-      __pyx_t_14 = PyObject_RichCompare(__pyx_t_4, __pyx_v_size, Py_LT); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1169, __pyx_L1_error)
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 1169, __pyx_L1_error)
+      __pyx_t_14 = PyObject_RichCompare(__pyx_t_2, __pyx_v_size, Py_LT); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1172, __pyx_L1_error)
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 1172, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
       if (unlikely(__pyx_t_12)) {
 
-        /* "mtrand.pyx":1170
+        /* "mtrand.pyx":1173
  *             if p is not None:
  *                 if np.count_nonzero(p > 0) < size:
  *                     raise ValueError("Fewer non-zero entries in p than size")             # <<<<<<<<<<<<<<
  *                 n_uniq = 0
  *                 p = p.copy()
  */
-        __pyx_t_14 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1170, __pyx_L1_error)
+        __pyx_t_14 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1173, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_14);
         __Pyx_Raise(__pyx_t_14, 0, 0, 0);
         __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
-        __PYX_ERR(0, 1170, __pyx_L1_error)
+        __PYX_ERR(0, 1173, __pyx_L1_error)
 
-        /* "mtrand.pyx":1169
+        /* "mtrand.pyx":1172
  * 
  *             if p is not None:
  *                 if np.count_nonzero(p > 0) < size:             # <<<<<<<<<<<<<<
@@ -18014,7 +18078,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_24choice(struct __pyx_obj_6mtran
  */
       }
 
-      /* "mtrand.pyx":1171
+      /* "mtrand.pyx":1174
  *                 if np.count_nonzero(p > 0) < size:
  *                     raise ValueError("Fewer non-zero entries in p than size")
  *                 n_uniq = 0             # <<<<<<<<<<<<<<
@@ -18024,75 +18088,75 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_24choice(struct __pyx_obj_6mtran
       __Pyx_INCREF(__pyx_int_0);
       __pyx_v_n_uniq = __pyx_int_0;
 
-      /* "mtrand.pyx":1172
+      /* "mtrand.pyx":1175
  *                     raise ValueError("Fewer non-zero entries in p than size")
  *                 n_uniq = 0
  *                 p = p.copy()             # <<<<<<<<<<<<<<
  *                 found = np.zeros(shape, dtype=np.int)
  *                 flat_found = found.ravel()
  */
-      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_p, __pyx_n_s_copy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1172, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_p, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1175, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
       __pyx_t_1 = NULL;
-      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
-        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
         if (likely(__pyx_t_1)) {
-          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
           __Pyx_INCREF(__pyx_t_1);
           __Pyx_INCREF(function);
-          __Pyx_DECREF_SET(__pyx_t_4, function);
+          __Pyx_DECREF_SET(__pyx_t_2, function);
         }
       }
-      __pyx_t_14 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+      __pyx_t_14 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
       __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
-      if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1172, __pyx_L1_error)
+      if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1175, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_14);
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       __Pyx_DECREF_SET(__pyx_v_p, __pyx_t_14);
       __pyx_t_14 = 0;
 
-      /* "mtrand.pyx":1173
+      /* "mtrand.pyx":1176
  *                 n_uniq = 0
  *                 p = p.copy()
  *                 found = np.zeros(shape, dtype=np.int)             # <<<<<<<<<<<<<<
  *                 flat_found = found.ravel()
  *                 while n_uniq < size:
  */
-      __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1173, __pyx_L1_error)
+      __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1176, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_14);
-      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1173, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1176, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
-      __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1173, __pyx_L1_error)
+      __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1176, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_14);
       __Pyx_INCREF(__pyx_v_shape);
       __Pyx_GIVEREF(__pyx_v_shape);
       PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v_shape);
-      __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1173, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1176, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1173, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1173, __pyx_L1_error)
+      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1176, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1176, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_9);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_9) < 0) __PYX_ERR(0, 1173, __pyx_L1_error)
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_9) < 0) __PYX_ERR(0, 1176, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_14, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1173, __pyx_L1_error)
+      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_14, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1176, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_9);
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
       __pyx_v_found = __pyx_t_9;
       __pyx_t_9 = 0;
 
-      /* "mtrand.pyx":1174
+      /* "mtrand.pyx":1177
  *                 p = p.copy()
  *                 found = np.zeros(shape, dtype=np.int)
  *                 flat_found = found.ravel()             # <<<<<<<<<<<<<<
  *                 while n_uniq < size:
  *                     x = self.rand(size - n_uniq)
  */
-      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_found, __pyx_n_s_ravel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1174, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_found, __pyx_n_s_ravel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1177, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __pyx_t_14 = NULL;
       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
@@ -18106,13 +18170,13 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_24choice(struct __pyx_obj_6mtran
       }
       __pyx_t_9 = (__pyx_t_14) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_14) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
       __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
-      if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1174, __pyx_L1_error)
+      if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1177, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_9);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
       __pyx_v_flat_found = __pyx_t_9;
       __pyx_t_9 = 0;
 
-      /* "mtrand.pyx":1175
+      /* "mtrand.pyx":1178
  *                 found = np.zeros(shape, dtype=np.int)
  *                 flat_found = found.ravel()
  *                 while n_uniq < size:             # <<<<<<<<<<<<<<
@@ -18120,66 +18184,66 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_24choice(struct __pyx_obj_6mtran
  *                     if n_uniq > 0:
  */
       while (1) {
-        __pyx_t_9 = PyObject_RichCompare(__pyx_v_n_uniq, __pyx_v_size, Py_LT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1175, __pyx_L1_error)
-        __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 1175, __pyx_L1_error)
+        __pyx_t_9 = PyObject_RichCompare(__pyx_v_n_uniq, __pyx_v_size, Py_LT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1178, __pyx_L1_error)
+        __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 1178, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
         if (!__pyx_t_12) break;
 
-        /* "mtrand.pyx":1176
+        /* "mtrand.pyx":1179
  *                 flat_found = found.ravel()
  *                 while n_uniq < size:
  *                     x = self.rand(size - n_uniq)             # <<<<<<<<<<<<<<
  *                     if n_uniq > 0:
  *                         p[flat_found[0:n_uniq]] = 0
  */
-        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rand); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1176, __pyx_L1_error)
+        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rand); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1179, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_1);
-        __pyx_t_14 = PyNumber_Subtract(__pyx_v_size, __pyx_v_n_uniq); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1176, __pyx_L1_error)
+        __pyx_t_14 = PyNumber_Subtract(__pyx_v_size, __pyx_v_n_uniq); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1179, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_14);
-        __pyx_t_4 = NULL;
+        __pyx_t_2 = NULL;
         if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
-          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
-          if (likely(__pyx_t_4)) {
+          __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
+          if (likely(__pyx_t_2)) {
             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
-            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(__pyx_t_2);
             __Pyx_INCREF(function);
             __Pyx_DECREF_SET(__pyx_t_1, function);
           }
         }
-        __pyx_t_9 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, __pyx_t_14) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_14);
-        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        __pyx_t_9 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_t_14) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_14);
+        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
         __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
-        if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1176, __pyx_L1_error)
+        if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1179, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_9);
         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
         __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_9);
         __pyx_t_9 = 0;
 
-        /* "mtrand.pyx":1177
+        /* "mtrand.pyx":1180
  *                 while n_uniq < size:
  *                     x = self.rand(size - n_uniq)
  *                     if n_uniq > 0:             # <<<<<<<<<<<<<<
  *                         p[flat_found[0:n_uniq]] = 0
  *                     cdf = np.cumsum(p)
  */
-        __pyx_t_9 = PyObject_RichCompare(__pyx_v_n_uniq, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1177, __pyx_L1_error)
-        __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 1177, __pyx_L1_error)
+        __pyx_t_9 = PyObject_RichCompare(__pyx_v_n_uniq, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1180, __pyx_L1_error)
+        __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 1180, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
         if (__pyx_t_12) {
 
-          /* "mtrand.pyx":1178
+          /* "mtrand.pyx":1181
  *                     x = self.rand(size - n_uniq)
  *                     if n_uniq > 0:
  *                         p[flat_found[0:n_uniq]] = 0             # <<<<<<<<<<<<<<
  *                     cdf = np.cumsum(p)
  *                     cdf /= cdf[-1]
  */
-          __pyx_t_9 = __Pyx_PyObject_GetSlice(__pyx_v_flat_found, 0, 0, NULL, &__pyx_v_n_uniq, NULL, 1, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1178, __pyx_L1_error)
+          __pyx_t_9 = __Pyx_PyObject_GetSlice(__pyx_v_flat_found, 0, 0, NULL, &__pyx_v_n_uniq, NULL, 1, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1181, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_9);
-          if (unlikely(PyObject_SetItem(__pyx_v_p, __pyx_t_9, __pyx_int_0) < 0)) __PYX_ERR(0, 1178, __pyx_L1_error)
+          if (unlikely(PyObject_SetItem(__pyx_v_p, __pyx_t_9, __pyx_int_0) < 0)) __PYX_ERR(0, 1181, __pyx_L1_error)
           __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-          /* "mtrand.pyx":1177
+          /* "mtrand.pyx":1180
  *                 while n_uniq < size:
  *                     x = self.rand(size - n_uniq)
  *                     if n_uniq > 0:             # <<<<<<<<<<<<<<
@@ -18188,16 +18252,16 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_24choice(struct __pyx_obj_6mtran
  */
         }
 
-        /* "mtrand.pyx":1179
+        /* "mtrand.pyx":1182
  *                     if n_uniq > 0:
  *                         p[flat_found[0:n_uniq]] = 0
  *                     cdf = np.cumsum(p)             # <<<<<<<<<<<<<<
  *                     cdf /= cdf[-1]
  *                     new = cdf.searchsorted(x, side='right')
  */
-        __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1179, __pyx_L1_error)
+        __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1182, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_1);
-        __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_cumsum); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1179, __pyx_L1_error)
+        __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_cumsum); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1182, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_14);
         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
         __pyx_t_1 = NULL;
@@ -18212,76 +18276,76 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_24choice(struct __pyx_obj_6mtran
         }
         __pyx_t_9 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_1, __pyx_v_p) : __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_v_p);
         __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
-        if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1179, __pyx_L1_error)
+        if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1182, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_9);
         __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
         __Pyx_XDECREF_SET(__pyx_v_cdf, __pyx_t_9);
         __pyx_t_9 = 0;
 
-        /* "mtrand.pyx":1180
+        /* "mtrand.pyx":1183
  *                         p[flat_found[0:n_uniq]] = 0
  *                     cdf = np.cumsum(p)
  *                     cdf /= cdf[-1]             # <<<<<<<<<<<<<<
  *                     new = cdf.searchsorted(x, side='right')
  *                     _, unique_indices = np.unique(new, return_index=True)
  */
-        __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_cdf, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1180, __pyx_L1_error)
+        __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_cdf, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1183, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_9);
-        __pyx_t_14 = __Pyx_PyNumber_InPlaceDivide(__pyx_v_cdf, __pyx_t_9); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1180, __pyx_L1_error)
+        __pyx_t_14 = __Pyx_PyNumber_InPlaceDivide(__pyx_v_cdf, __pyx_t_9); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1183, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_14);
         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
         __Pyx_DECREF_SET(__pyx_v_cdf, __pyx_t_14);
         __pyx_t_14 = 0;
 
-        /* "mtrand.pyx":1181
+        /* "mtrand.pyx":1184
  *                     cdf = np.cumsum(p)
  *                     cdf /= cdf[-1]
  *                     new = cdf.searchsorted(x, side='right')             # <<<<<<<<<<<<<<
  *                     _, unique_indices = np.unique(new, return_index=True)
  *                     unique_indices.sort()
  */
-        __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_cdf, __pyx_n_s_searchsorted); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1181, __pyx_L1_error)
+        __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_cdf, __pyx_n_s_searchsorted); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1184, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_14);
-        __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1181, __pyx_L1_error)
+        __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1184, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_9);
         __Pyx_INCREF(__pyx_v_x);
         __Pyx_GIVEREF(__pyx_v_x);
         PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_x);
-        __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error)
+        __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1184, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_1);
-        if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_side, __pyx_n_s_right) < 0) __PYX_ERR(0, 1181, __pyx_L1_error)
-        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_9, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1181, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_4);
+        if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_side, __pyx_n_s_right) < 0) __PYX_ERR(0, 1184, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_9, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1184, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
         __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        __Pyx_XDECREF_SET(__pyx_v_new, __pyx_t_4);
-        __pyx_t_4 = 0;
+        __Pyx_XDECREF_SET(__pyx_v_new, __pyx_t_2);
+        __pyx_t_2 = 0;
 
-        /* "mtrand.pyx":1182
+        /* "mtrand.pyx":1185
  *                     cdf /= cdf[-1]
  *                     new = cdf.searchsorted(x, side='right')
  *                     _, unique_indices = np.unique(new, return_index=True)             # <<<<<<<<<<<<<<
  *                     unique_indices.sort()
  *                     new = new.take(unique_indices)
  */
-        __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1182, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_4);
-        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_unique); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1182, __pyx_L1_error)
+        __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1185, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_unique); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1185, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_1);
-        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-        __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1182, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1185, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
         __Pyx_INCREF(__pyx_v_new);
         __Pyx_GIVEREF(__pyx_v_new);
-        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_new);
-        __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1182, __pyx_L1_error)
+        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_new);
+        __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1185, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_9);
-        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_return_index, Py_True) < 0) __PYX_ERR(0, 1182, __pyx_L1_error)
-        __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_9); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1182, __pyx_L1_error)
+        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_return_index, Py_True) < 0) __PYX_ERR(0, 1185, __pyx_L1_error)
+        __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_9); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1185, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_14);
         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
         if ((likely(PyTuple_CheckExact(__pyx_t_14))) || (PyList_CheckExact(__pyx_t_14))) {
           PyObject* sequence = __pyx_t_14;
@@ -18289,136 +18353,136 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_24choice(struct __pyx_obj_6mtran
           if (unlikely(size != 2)) {
             if (size > 2) __Pyx_RaiseTooManyValuesError(2);
             else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-            __PYX_ERR(0, 1182, __pyx_L1_error)
+            __PYX_ERR(0, 1185, __pyx_L1_error)
           }
           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
           if (likely(PyTuple_CheckExact(sequence))) {
             __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); 
-            __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
+            __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
           } else {
             __pyx_t_9 = PyList_GET_ITEM(sequence, 0); 
-            __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
+            __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
           }
           __Pyx_INCREF(__pyx_t_9);
-          __Pyx_INCREF(__pyx_t_4);
+          __Pyx_INCREF(__pyx_t_2);
           #else
-          __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1182, __pyx_L1_error)
+          __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1185, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_9);
-          __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1182, __pyx_L1_error)
-          __Pyx_GOTREF(__pyx_t_4);
+          __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1185, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_2);
           #endif
           __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
         } else {
           Py_ssize_t index = -1;
-          __pyx_t_1 = PyObject_GetIter(__pyx_t_14); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1182, __pyx_L1_error)
+          __pyx_t_1 = PyObject_GetIter(__pyx_t_14); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1185, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_1);
           __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
-          __pyx_t_16 = Py_TYPE(__pyx_t_1)->tp_iternext;
-          index = 0; __pyx_t_9 = __pyx_t_16(__pyx_t_1); if (unlikely(!__pyx_t_9)) goto __pyx_L34_unpacking_failed;
+          __pyx_t_15 = Py_TYPE(__pyx_t_1)->tp_iternext;
+          index = 0; __pyx_t_9 = __pyx_t_15(__pyx_t_1); if (unlikely(!__pyx_t_9)) goto __pyx_L35_unpacking_failed;
           __Pyx_GOTREF(__pyx_t_9);
-          index = 1; __pyx_t_4 = __pyx_t_16(__pyx_t_1); if (unlikely(!__pyx_t_4)) goto __pyx_L34_unpacking_failed;
-          __Pyx_GOTREF(__pyx_t_4);
-          if (__Pyx_IternextUnpackEndCheck(__pyx_t_16(__pyx_t_1), 2) < 0) __PYX_ERR(0, 1182, __pyx_L1_error)
-          __pyx_t_16 = NULL;
+          index = 1; __pyx_t_2 = __pyx_t_15(__pyx_t_1); if (unlikely(!__pyx_t_2)) goto __pyx_L35_unpacking_failed;
+          __Pyx_GOTREF(__pyx_t_2);
+          if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_1), 2) < 0) __PYX_ERR(0, 1185, __pyx_L1_error)
+          __pyx_t_15 = NULL;
           __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-          goto __pyx_L35_unpacking_done;
-          __pyx_L34_unpacking_failed:;
+          goto __pyx_L36_unpacking_done;
+          __pyx_L35_unpacking_failed:;
           __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-          __pyx_t_16 = NULL;
+          __pyx_t_15 = NULL;
           if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-          __PYX_ERR(0, 1182, __pyx_L1_error)
-          __pyx_L35_unpacking_done:;
+          __PYX_ERR(0, 1185, __pyx_L1_error)
+          __pyx_L36_unpacking_done:;
         }
         __Pyx_XDECREF_SET(__pyx_v__, __pyx_t_9);
         __pyx_t_9 = 0;
-        __Pyx_XDECREF_SET(__pyx_v_unique_indices, __pyx_t_4);
-        __pyx_t_4 = 0;
+        __Pyx_XDECREF_SET(__pyx_v_unique_indices, __pyx_t_2);
+        __pyx_t_2 = 0;
 
-        /* "mtrand.pyx":1183
+        /* "mtrand.pyx":1186
  *                     new = cdf.searchsorted(x, side='right')
  *                     _, unique_indices = np.unique(new, return_index=True)
  *                     unique_indices.sort()             # <<<<<<<<<<<<<<
  *                     new = new.take(unique_indices)
  *                     flat_found[n_uniq:n_uniq + new.size] = new
  */
-        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_unique_indices, __pyx_n_s_sort); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1183, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_4);
+        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_unique_indices, __pyx_n_s_sort); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1186, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
         __pyx_t_9 = NULL;
-        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
-          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2);
           if (likely(__pyx_t_9)) {
-            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
             __Pyx_INCREF(__pyx_t_9);
             __Pyx_INCREF(function);
-            __Pyx_DECREF_SET(__pyx_t_4, function);
+            __Pyx_DECREF_SET(__pyx_t_2, function);
           }
         }
-        __pyx_t_14 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+        __pyx_t_14 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
         __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
-        if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1183, __pyx_L1_error)
+        if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1186, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_14);
-        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
         __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
 
-        /* "mtrand.pyx":1184
+        /* "mtrand.pyx":1187
  *                     _, unique_indices = np.unique(new, return_index=True)
  *                     unique_indices.sort()
  *                     new = new.take(unique_indices)             # <<<<<<<<<<<<<<
  *                     flat_found[n_uniq:n_uniq + new.size] = new
  *                     n_uniq += new.size
  */
-        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_new, __pyx_n_s_take); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1184, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_4);
+        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_new, __pyx_n_s_take); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1187, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
         __pyx_t_9 = NULL;
-        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
-          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2);
           if (likely(__pyx_t_9)) {
-            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
             __Pyx_INCREF(__pyx_t_9);
             __Pyx_INCREF(function);
-            __Pyx_DECREF_SET(__pyx_t_4, function);
+            __Pyx_DECREF_SET(__pyx_t_2, function);
           }
         }
-        __pyx_t_14 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_9, __pyx_v_unique_indices) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_unique_indices);
+        __pyx_t_14 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_9, __pyx_v_unique_indices) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_unique_indices);
         __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
-        if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1184, __pyx_L1_error)
+        if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1187, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_14);
-        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
         __Pyx_DECREF_SET(__pyx_v_new, __pyx_t_14);
         __pyx_t_14 = 0;
 
-        /* "mtrand.pyx":1185
+        /* "mtrand.pyx":1188
  *                     unique_indices.sort()
  *                     new = new.take(unique_indices)
  *                     flat_found[n_uniq:n_uniq + new.size] = new             # <<<<<<<<<<<<<<
  *                     n_uniq += new.size
  *                 idx = found
  */
-        __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_new, __pyx_n_s_size); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1185, __pyx_L1_error)
+        __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_new, __pyx_n_s_size); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1188, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_14);
-        __pyx_t_4 = PyNumber_Add(__pyx_v_n_uniq, __pyx_t_14); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1185, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_4);
+        __pyx_t_2 = PyNumber_Add(__pyx_v_n_uniq, __pyx_t_14); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1188, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
         __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
-        if (__Pyx_PyObject_SetSlice(__pyx_v_flat_found, __pyx_v_new, 0, 0, &__pyx_v_n_uniq, &__pyx_t_4, NULL, 0, 0, 1) < 0) __PYX_ERR(0, 1185, __pyx_L1_error)
-        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (__Pyx_PyObject_SetSlice(__pyx_v_flat_found, __pyx_v_new, 0, 0, &__pyx_v_n_uniq, &__pyx_t_2, NULL, 0, 0, 1) < 0) __PYX_ERR(0, 1188, __pyx_L1_error)
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-        /* "mtrand.pyx":1186
+        /* "mtrand.pyx":1189
  *                     new = new.take(unique_indices)
  *                     flat_found[n_uniq:n_uniq + new.size] = new
  *                     n_uniq += new.size             # <<<<<<<<<<<<<<
  *                 idx = found
  *             else:
  */
-        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_new, __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1186, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_4);
-        __pyx_t_14 = PyNumber_InPlaceAdd(__pyx_v_n_uniq, __pyx_t_4); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1186, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_new, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1189, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __pyx_t_14 = PyNumber_InPlaceAdd(__pyx_v_n_uniq, __pyx_t_2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1189, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_14);
-        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
         __Pyx_DECREF_SET(__pyx_v_n_uniq, __pyx_t_14);
         __pyx_t_14 = 0;
       }
 
-      /* "mtrand.pyx":1187
+      /* "mtrand.pyx":1190
  *                     flat_found[n_uniq:n_uniq + new.size] = new
  *                     n_uniq += new.size
  *                 idx = found             # <<<<<<<<<<<<<<
@@ -18428,17 +18492,17 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_24choice(struct __pyx_obj_6mtran
       __Pyx_INCREF(__pyx_v_found);
       __pyx_v_idx = __pyx_v_found;
 
-      /* "mtrand.pyx":1168
+      /* "mtrand.pyx":1171
  *                                  "population when 'replace=False'")
  * 
  *             if p is not None:             # <<<<<<<<<<<<<<
  *                 if np.count_nonzero(p > 0) < size:
  *                     raise ValueError("Fewer non-zero entries in p than size")
  */
-      goto __pyx_L29;
+      goto __pyx_L30;
     }
 
-    /* "mtrand.pyx":1189
+    /* "mtrand.pyx":1192
  *                 idx = found
  *             else:
  *                 idx = self.permutation(pop_size)[:size]             # <<<<<<<<<<<<<<
@@ -18446,30 +18510,30 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_24choice(struct __pyx_obj_6mtran
  *                     idx.shape = shape
  */
     /*else*/ {
-      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_permutation); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1189, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_permutation); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1192, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
       __pyx_t_9 = NULL;
-      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
-        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2);
         if (likely(__pyx_t_9)) {
-          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
           __Pyx_INCREF(__pyx_t_9);
           __Pyx_INCREF(function);
-          __Pyx_DECREF_SET(__pyx_t_4, function);
+          __Pyx_DECREF_SET(__pyx_t_2, function);
         }
       }
-      __pyx_t_14 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_9, __pyx_v_pop_size) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_pop_size);
+      __pyx_t_14 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_9, __pyx_v_pop_size) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_pop_size);
       __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
-      if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1189, __pyx_L1_error)
+      if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1192, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_14);
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_t_14, 0, 0, NULL, &__pyx_v_size, NULL, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1189, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_t_14, 0, 0, NULL, &__pyx_v_size, NULL, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1192, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
-      __pyx_v_idx = __pyx_t_4;
-      __pyx_t_4 = 0;
+      __pyx_v_idx = __pyx_t_2;
+      __pyx_t_2 = 0;
 
-      /* "mtrand.pyx":1190
+      /* "mtrand.pyx":1193
  *             else:
  *                 idx = self.permutation(pop_size)[:size]
  *                 if shape is not None:             # <<<<<<<<<<<<<<
@@ -18480,16 +18544,16 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_24choice(struct __pyx_obj_6mtran
       __pyx_t_5 = (__pyx_t_12 != 0);
       if (__pyx_t_5) {
 
-        /* "mtrand.pyx":1191
+        /* "mtrand.pyx":1194
  *                 idx = self.permutation(pop_size)[:size]
  *                 if shape is not None:
  *                     idx.shape = shape             # <<<<<<<<<<<<<<
  * 
  *         if shape is None and isinstance(idx, np.ndarray):
  */
-        if (__Pyx_PyObject_SetAttrStr(__pyx_v_idx, __pyx_n_s_shape, __pyx_v_shape) < 0) __PYX_ERR(0, 1191, __pyx_L1_error)
+        if (__Pyx_PyObject_SetAttrStr(__pyx_v_idx, __pyx_n_s_shape, __pyx_v_shape) < 0) __PYX_ERR(0, 1194, __pyx_L1_error)
 
-        /* "mtrand.pyx":1190
+        /* "mtrand.pyx":1193
  *             else:
  *                 idx = self.permutation(pop_size)[:size]
  *                 if shape is not None:             # <<<<<<<<<<<<<<
@@ -18498,11 +18562,11 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_24choice(struct __pyx_obj_6mtran
  */
       }
     }
-    __pyx_L29:;
+    __pyx_L30:;
   }
-  __pyx_L26:;
+  __pyx_L27:;
 
-  /* "mtrand.pyx":1193
+  /* "mtrand.pyx":1196
  *                     idx.shape = shape
  * 
  *         if shape is None and isinstance(idx, np.ndarray):             # <<<<<<<<<<<<<<
@@ -18514,48 +18578,48 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_24choice(struct __pyx_obj_6mtran
   if (__pyx_t_11) {
   } else {
     __pyx_t_5 = __pyx_t_11;
-    goto __pyx_L38_bool_binop_done;
+    goto __pyx_L39_bool_binop_done;
   }
-  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1193, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1193, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1196, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1196, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_14);
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_11 = PyObject_IsInstance(__pyx_v_idx, __pyx_t_14); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 1193, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_11 = PyObject_IsInstance(__pyx_v_idx, __pyx_t_14); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 1196, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
   __pyx_t_12 = (__pyx_t_11 != 0);
   __pyx_t_5 = __pyx_t_12;
-  __pyx_L38_bool_binop_done:;
+  __pyx_L39_bool_binop_done:;
   if (__pyx_t_5) {
 
-    /* "mtrand.pyx":1195
+    /* "mtrand.pyx":1198
  *         if shape is None and isinstance(idx, np.ndarray):
  *             # In most cases a scalar will have been made an array
  *             idx = idx.item(0)             # <<<<<<<<<<<<<<
  * 
  *         #Use samples as indices for a if a is array-like
  */
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_idx, __pyx_n_s_item); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1195, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_idx, __pyx_n_s_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1198, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
     __pyx_t_9 = NULL;
-    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
-      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2);
       if (likely(__pyx_t_9)) {
-        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
         __Pyx_INCREF(__pyx_t_9);
         __Pyx_INCREF(function);
-        __Pyx_DECREF_SET(__pyx_t_4, function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
       }
     }
-    __pyx_t_14 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_9, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_int_0);
+    __pyx_t_14 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_9, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_int_0);
     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
-    if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1195, __pyx_L1_error)
+    if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1198, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_14);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_DECREF_SET(__pyx_v_idx, __pyx_t_14);
     __pyx_t_14 = 0;
 
-    /* "mtrand.pyx":1193
+    /* "mtrand.pyx":1196
  *                     idx.shape = shape
  * 
  *         if shape is None and isinstance(idx, np.ndarray):             # <<<<<<<<<<<<<<
@@ -18564,23 +18628,23 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_24choice(struct __pyx_obj_6mtran
  */
   }
 
-  /* "mtrand.pyx":1198
+  /* "mtrand.pyx":1201
  * 
  *         #Use samples as indices for a if a is array-like
  *         if a.ndim == 0:             # <<<<<<<<<<<<<<
  *             return idx
  * 
  */
-  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_ndim); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1198, __pyx_L1_error)
+  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_ndim); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1201, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_14);
-  __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_t_14, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1198, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_14, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1201, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1198, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1201, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (__pyx_t_5) {
 
-    /* "mtrand.pyx":1199
+    /* "mtrand.pyx":1202
  *         #Use samples as indices for a if a is array-like
  *         if a.ndim == 0:
  *             return idx             # <<<<<<<<<<<<<<
@@ -18592,7 +18656,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_24choice(struct __pyx_obj_6mtran
     __pyx_r = __pyx_v_idx;
     goto __pyx_L0;
 
-    /* "mtrand.pyx":1198
+    /* "mtrand.pyx":1201
  * 
  *         #Use samples as indices for a if a is array-like
  *         if a.ndim == 0:             # <<<<<<<<<<<<<<
@@ -18601,7 +18665,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_24choice(struct __pyx_obj_6mtran
  */
   }
 
-  /* "mtrand.pyx":1201
+  /* "mtrand.pyx":1204
  *             return idx
  * 
  *         if shape is not None and idx.ndim == 0:             # <<<<<<<<<<<<<<
@@ -18613,57 +18677,57 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_24choice(struct __pyx_obj_6mtran
   if (__pyx_t_11) {
   } else {
     __pyx_t_5 = __pyx_t_11;
-    goto __pyx_L42_bool_binop_done;
+    goto __pyx_L43_bool_binop_done;
   }
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_idx, __pyx_n_s_ndim); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1201, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_14 = __Pyx_PyInt_EqObjC(__pyx_t_4, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1201, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_idx, __pyx_n_s_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1204, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_14 = __Pyx_PyInt_EqObjC(__pyx_t_2, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1204, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_14);
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 1201, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 1204, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
   __pyx_t_5 = __pyx_t_11;
-  __pyx_L42_bool_binop_done:;
+  __pyx_L43_bool_binop_done:;
   if (__pyx_t_5) {
 
-    /* "mtrand.pyx":1207
+    /* "mtrand.pyx":1210
  *             # array, taking into account that np.array(item) may not work
  *             # for object arrays.
  *             res = np.empty((), dtype=a.dtype)             # <<<<<<<<<<<<<<
  *             res[()] = a[idx]
  *             return res
  */
-    __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1207, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1210, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_14);
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1207, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1210, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
-    __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1207, __pyx_L1_error)
+    __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1210, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_14);
-    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_dtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1207, __pyx_L1_error)
+    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_dtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1210, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_9);
-    if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_dtype, __pyx_t_9) < 0) __PYX_ERR(0, 1207, __pyx_L1_error)
+    if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_dtype, __pyx_t_9) < 0) __PYX_ERR(0, 1210, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__25, __pyx_t_14); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1207, __pyx_L1_error)
+    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__26, __pyx_t_14); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1210, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_9);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
     __pyx_v_res = __pyx_t_9;
     __pyx_t_9 = 0;
 
-    /* "mtrand.pyx":1208
+    /* "mtrand.pyx":1211
  *             # for object arrays.
  *             res = np.empty((), dtype=a.dtype)
  *             res[()] = a[idx]             # <<<<<<<<<<<<<<
  *             return res
  * 
  */
-    __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_v_a, __pyx_v_idx); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1208, __pyx_L1_error)
+    __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_v_a, __pyx_v_idx); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1211, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_9);
-    if (unlikely(PyObject_SetItem(__pyx_v_res, __pyx_empty_tuple, __pyx_t_9) < 0)) __PYX_ERR(0, 1208, __pyx_L1_error)
+    if (unlikely(PyObject_SetItem(__pyx_v_res, __pyx_empty_tuple, __pyx_t_9) < 0)) __PYX_ERR(0, 1211, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-    /* "mtrand.pyx":1209
+    /* "mtrand.pyx":1212
  *             res = np.empty((), dtype=a.dtype)
  *             res[()] = a[idx]
  *             return res             # <<<<<<<<<<<<<<
@@ -18675,7 +18739,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_24choice(struct __pyx_obj_6mtran
     __pyx_r = __pyx_v_res;
     goto __pyx_L0;
 
-    /* "mtrand.pyx":1201
+    /* "mtrand.pyx":1204
  *             return idx
  * 
  *         if shape is not None and idx.ndim == 0:             # <<<<<<<<<<<<<<
@@ -18684,7 +18748,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_24choice(struct __pyx_obj_6mtran
  */
   }
 
-  /* "mtrand.pyx":1211
+  /* "mtrand.pyx":1214
  *             return res
  * 
  *         return a[idx]             # <<<<<<<<<<<<<<
@@ -18692,7 +18756,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_24choice(struct __pyx_obj_6mtran
  * 
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_v_a, __pyx_v_idx); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1211, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_v_a, __pyx_v_idx); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1214, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __pyx_r = __pyx_t_9;
   __pyx_t_9 = 0;
@@ -18718,7 +18782,6 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_24choice(struct __pyx_obj_6mtran
   __pyx_r = NULL;
   __pyx_L0:;
   __Pyx_XDECREF(__pyx_v_pop_size);
-  __Pyx_XDECREF(__pyx_v_d);
   __Pyx_XDECREF(__pyx_v_atol);
   __Pyx_XDECREF(__pyx_v_shape);
   __Pyx_XDECREF(__pyx_v_cdf);
@@ -18740,7 +18803,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_24choice(struct __pyx_obj_6mtran
   return __pyx_r;
 }
 
-/* "mtrand.pyx":1214
+/* "mtrand.pyx":1217
  * 
  * 
  *     def uniform(self, low=0.0, high=1.0, size=None):             # <<<<<<<<<<<<<<
@@ -18798,7 +18861,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_27uniform(PyObject *__pyx_v_self
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "uniform") < 0)) __PYX_ERR(0, 1214, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "uniform") < 0)) __PYX_ERR(0, 1217, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -18818,7 +18881,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_27uniform(PyObject *__pyx_v_self
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("uniform", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1214, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("uniform", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1217, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("mtrand.RandomState.uniform", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -18852,14 +18915,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_26uniform(struct __pyx_obj_6mtra
   int __pyx_t_9;
   __Pyx_RefNannySetupContext("uniform", 0);
 
-  /* "mtrand.pyx":1295
+  /* "mtrand.pyx":1298
  *         cdef object temp
  * 
  *         olow = <ndarray>PyArray_FROM_OTF(low, NPY_DOUBLE, NPY_ARRAY_ALIGNED)             # <<<<<<<<<<<<<<
  *         ohigh = <ndarray>PyArray_FROM_OTF(high, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  */
-  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_low, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1295, __pyx_L1_error)
+  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_low, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1298, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_2 = __pyx_t_1;
   __Pyx_INCREF(__pyx_t_2);
@@ -18867,14 +18930,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_26uniform(struct __pyx_obj_6mtra
   __pyx_v_olow = ((PyArrayObject *)__pyx_t_2);
   __pyx_t_2 = 0;
 
-  /* "mtrand.pyx":1296
+  /* "mtrand.pyx":1299
  * 
  *         olow = <ndarray>PyArray_FROM_OTF(low, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  *         ohigh = <ndarray>PyArray_FROM_OTF(high, NPY_DOUBLE, NPY_ARRAY_ALIGNED)             # <<<<<<<<<<<<<<
  * 
  *         if olow.shape == ohigh.shape == ():
  */
-  __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_high, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1296, __pyx_L1_error)
+  __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_high, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1299, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_1 = __pyx_t_2;
   __Pyx_INCREF(__pyx_t_1);
@@ -18882,49 +18945,49 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_26uniform(struct __pyx_obj_6mtra
   __pyx_v_ohigh = ((PyArrayObject *)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "mtrand.pyx":1298
+  /* "mtrand.pyx":1301
  *         ohigh = <ndarray>PyArray_FROM_OTF(high, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if olow.shape == ohigh.shape == ():             # <<<<<<<<<<<<<<
  *             flow = PyFloat_AsDouble(low)
  *             fhigh = PyFloat_AsDouble(high)
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_olow), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1298, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_olow), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1301, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ohigh), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1298, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ohigh), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1301, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1298, __pyx_L1_error)
+  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1301, __pyx_L1_error)
   if (__Pyx_PyObject_IsTrue(__pyx_t_3)) {
     __Pyx_DECREF(__pyx_t_3);
-    __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1298, __pyx_L1_error)
+    __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1301, __pyx_L1_error)
   }
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1298, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1301, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   if (__pyx_t_4) {
 
-    /* "mtrand.pyx":1299
+    /* "mtrand.pyx":1302
  * 
  *         if olow.shape == ohigh.shape == ():
  *             flow = PyFloat_AsDouble(low)             # <<<<<<<<<<<<<<
  *             fhigh = PyFloat_AsDouble(high)
  *             fscale = fhigh - flow
  */
-    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_low); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 1299, __pyx_L1_error)
+    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_low); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 1302, __pyx_L1_error)
     __pyx_v_flow = __pyx_t_5;
 
-    /* "mtrand.pyx":1300
+    /* "mtrand.pyx":1303
  *         if olow.shape == ohigh.shape == ():
  *             flow = PyFloat_AsDouble(low)
  *             fhigh = PyFloat_AsDouble(high)             # <<<<<<<<<<<<<<
  *             fscale = fhigh - flow
  * 
  */
-    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_high); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 1300, __pyx_L1_error)
+    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_high); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 1303, __pyx_L1_error)
     __pyx_v_fhigh = __pyx_t_5;
 
-    /* "mtrand.pyx":1301
+    /* "mtrand.pyx":1304
  *             flow = PyFloat_AsDouble(low)
  *             fhigh = PyFloat_AsDouble(high)
  *             fscale = fhigh - flow             # <<<<<<<<<<<<<<
@@ -18933,7 +18996,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_26uniform(struct __pyx_obj_6mtra
  */
     __pyx_v_fscale = (__pyx_v_fhigh - __pyx_v_flow);
 
-    /* "mtrand.pyx":1303
+    /* "mtrand.pyx":1306
  *             fscale = fhigh - flow
  * 
  *             if not npy_isfinite(fscale):             # <<<<<<<<<<<<<<
@@ -18943,20 +19006,20 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_26uniform(struct __pyx_obj_6mtra
     __pyx_t_4 = ((!(npy_isfinite(__pyx_v_fscale) != 0)) != 0);
     if (unlikely(__pyx_t_4)) {
 
-      /* "mtrand.pyx":1304
+      /* "mtrand.pyx":1307
  * 
  *             if not npy_isfinite(fscale):
  *                 raise OverflowError('Range exceeds valid bounds')             # <<<<<<<<<<<<<<
  * 
  *             return cont2_array_sc(self.internal_state, rk_uniform, size, flow,
  */
-      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_OverflowError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1304, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_OverflowError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1307, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __PYX_ERR(0, 1304, __pyx_L1_error)
+      __PYX_ERR(0, 1307, __pyx_L1_error)
 
-      /* "mtrand.pyx":1303
+      /* "mtrand.pyx":1306
  *             fscale = fhigh - flow
  * 
  *             if not npy_isfinite(fscale):             # <<<<<<<<<<<<<<
@@ -18965,7 +19028,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_26uniform(struct __pyx_obj_6mtra
  */
     }
 
-    /* "mtrand.pyx":1306
+    /* "mtrand.pyx":1309
  *                 raise OverflowError('Range exceeds valid bounds')
  * 
  *             return cont2_array_sc(self.internal_state, rk_uniform, size, flow,             # <<<<<<<<<<<<<<
@@ -18974,7 +19037,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_26uniform(struct __pyx_obj_6mtra
  */
     __Pyx_XDECREF(__pyx_r);
 
-    /* "mtrand.pyx":1307
+    /* "mtrand.pyx":1310
  * 
  *             return cont2_array_sc(self.internal_state, rk_uniform, size, flow,
  *                                   fscale, self.lock)             # <<<<<<<<<<<<<<
@@ -18984,21 +19047,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_26uniform(struct __pyx_obj_6mtra
     __pyx_t_3 = __pyx_v_self->lock;
     __Pyx_INCREF(__pyx_t_3);
 
-    /* "mtrand.pyx":1306
+    /* "mtrand.pyx":1309
  *                 raise OverflowError('Range exceeds valid bounds')
  * 
  *             return cont2_array_sc(self.internal_state, rk_uniform, size, flow,             # <<<<<<<<<<<<<<
  *                                   fscale, self.lock)
  * 
  */
-    __pyx_t_2 = __pyx_f_6mtrand_cont2_array_sc(__pyx_v_self->internal_state, rk_uniform, __pyx_v_size, __pyx_v_flow, __pyx_v_fscale, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1306, __pyx_L1_error)
+    __pyx_t_2 = __pyx_f_6mtrand_cont2_array_sc(__pyx_v_self->internal_state, rk_uniform, __pyx_v_size, __pyx_v_flow, __pyx_v_fscale, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1309, __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;
 
-    /* "mtrand.pyx":1298
+    /* "mtrand.pyx":1301
  *         ohigh = <ndarray>PyArray_FROM_OTF(high, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if olow.shape == ohigh.shape == ():             # <<<<<<<<<<<<<<
@@ -19007,16 +19070,16 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_26uniform(struct __pyx_obj_6mtra
  */
   }
 
-  /* "mtrand.pyx":1309
+  /* "mtrand.pyx":1312
  *                                   fscale, self.lock)
  * 
  *         temp = np.subtract(ohigh, olow)             # <<<<<<<<<<<<<<
  *         Py_INCREF(temp)  # needed to get around Pyrex's automatic reference-counting
  *                          # rules because EnsureArray steals a reference
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1309, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1312, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_subtract); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1309, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_subtract); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1312, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __pyx_t_3 = NULL;
@@ -19034,7 +19097,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_26uniform(struct __pyx_obj_6mtra
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_1)) {
     PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_ohigh), ((PyObject *)__pyx_v_olow)};
-    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1309, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1312, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_GOTREF(__pyx_t_2);
   } else
@@ -19042,13 +19105,13 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_26uniform(struct __pyx_obj_6mtra
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
     PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_ohigh), ((PyObject *)__pyx_v_olow)};
-    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1309, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1312, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_GOTREF(__pyx_t_2);
   } else
   #endif
   {
-    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1309, __pyx_L1_error)
+    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1312, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_7);
     if (__pyx_t_3) {
       __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL;
@@ -19059,7 +19122,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_26uniform(struct __pyx_obj_6mtra
     __Pyx_INCREF(((PyObject *)__pyx_v_olow));
     __Pyx_GIVEREF(((PyObject *)__pyx_v_olow));
     PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, ((PyObject *)__pyx_v_olow));
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1309, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1312, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   }
@@ -19067,7 +19130,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_26uniform(struct __pyx_obj_6mtra
   __pyx_v_temp = __pyx_t_2;
   __pyx_t_2 = 0;
 
-  /* "mtrand.pyx":1310
+  /* "mtrand.pyx":1313
  * 
  *         temp = np.subtract(ohigh, olow)
  *         Py_INCREF(temp)  # needed to get around Pyrex's automatic reference-counting             # <<<<<<<<<<<<<<
@@ -19076,14 +19139,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_26uniform(struct __pyx_obj_6mtra
  */
   Py_INCREF(__pyx_v_temp);
 
-  /* "mtrand.pyx":1312
+  /* "mtrand.pyx":1315
  *         Py_INCREF(temp)  # needed to get around Pyrex's automatic reference-counting
  *                          # rules because EnsureArray steals a reference
  *         odiff = <ndarray>PyArray_EnsureArray(temp)             # <<<<<<<<<<<<<<
  * 
  *         if not np.all(np.isfinite(odiff)):
  */
-  __pyx_t_2 = PyArray_EnsureArray(__pyx_v_temp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1312, __pyx_L1_error)
+  __pyx_t_2 = PyArray_EnsureArray(__pyx_v_temp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1315, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_1 = __pyx_t_2;
   __Pyx_INCREF(__pyx_t_1);
@@ -19091,21 +19154,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_26uniform(struct __pyx_obj_6mtra
   __pyx_v_odiff = ((PyArrayObject *)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "mtrand.pyx":1314
+  /* "mtrand.pyx":1317
  *         odiff = <ndarray>PyArray_EnsureArray(temp)
  * 
  *         if not np.all(np.isfinite(odiff)):             # <<<<<<<<<<<<<<
  *             raise OverflowError('Range exceeds valid bounds')
  * 
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1314, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1317, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_all); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1314, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_all); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1317, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1314, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1317, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_isfinite); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1314, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_isfinite); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1317, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __pyx_t_3 = NULL;
@@ -19120,7 +19183,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_26uniform(struct __pyx_obj_6mtra
   }
   __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_3, ((PyObject *)__pyx_v_odiff)) : __Pyx_PyObject_CallOneArg(__pyx_t_8, ((PyObject *)__pyx_v_odiff));
   __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1314, __pyx_L1_error)
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1317, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   __pyx_t_8 = NULL;
@@ -19136,28 +19199,28 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_26uniform(struct __pyx_obj_6mtra
   __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_2);
   __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1314, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1317, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1314, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1317, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_t_9 = ((!__pyx_t_4) != 0);
   if (unlikely(__pyx_t_9)) {
 
-    /* "mtrand.pyx":1315
+    /* "mtrand.pyx":1318
  * 
  *         if not np.all(np.isfinite(odiff)):
  *             raise OverflowError('Range exceeds valid bounds')             # <<<<<<<<<<<<<<
  * 
  *         return cont2_array(self.internal_state, rk_uniform, size, olow, odiff,
  */
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_OverflowError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1315, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_OverflowError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1318, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __PYX_ERR(0, 1315, __pyx_L1_error)
+    __PYX_ERR(0, 1318, __pyx_L1_error)
 
-    /* "mtrand.pyx":1314
+    /* "mtrand.pyx":1317
  *         odiff = <ndarray>PyArray_EnsureArray(temp)
  * 
  *         if not np.all(np.isfinite(odiff)):             # <<<<<<<<<<<<<<
@@ -19166,7 +19229,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_26uniform(struct __pyx_obj_6mtra
  */
   }
 
-  /* "mtrand.pyx":1317
+  /* "mtrand.pyx":1320
  *             raise OverflowError('Range exceeds valid bounds')
  * 
  *         return cont2_array(self.internal_state, rk_uniform, size, olow, odiff,             # <<<<<<<<<<<<<<
@@ -19175,7 +19238,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_26uniform(struct __pyx_obj_6mtra
  */
   __Pyx_XDECREF(__pyx_r);
 
-  /* "mtrand.pyx":1318
+  /* "mtrand.pyx":1321
  * 
  *         return cont2_array(self.internal_state, rk_uniform, size, olow, odiff,
  *                            self.lock)             # <<<<<<<<<<<<<<
@@ -19185,21 +19248,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_26uniform(struct __pyx_obj_6mtra
   __pyx_t_1 = __pyx_v_self->lock;
   __Pyx_INCREF(__pyx_t_1);
 
-  /* "mtrand.pyx":1317
+  /* "mtrand.pyx":1320
  *             raise OverflowError('Range exceeds valid bounds')
  * 
  *         return cont2_array(self.internal_state, rk_uniform, size, olow, odiff,             # <<<<<<<<<<<<<<
  *                            self.lock)
  * 
  */
-  __pyx_t_7 = __pyx_f_6mtrand_cont2_array(__pyx_v_self->internal_state, rk_uniform, __pyx_v_size, __pyx_v_olow, __pyx_v_odiff, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1317, __pyx_L1_error)
+  __pyx_t_7 = __pyx_f_6mtrand_cont2_array(__pyx_v_self->internal_state, rk_uniform, __pyx_v_size, __pyx_v_olow, __pyx_v_odiff, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1320, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_r = __pyx_t_7;
   __pyx_t_7 = 0;
   goto __pyx_L0;
 
-  /* "mtrand.pyx":1214
+  /* "mtrand.pyx":1217
  * 
  * 
  *     def uniform(self, low=0.0, high=1.0, size=None):             # <<<<<<<<<<<<<<
@@ -19226,7 +19289,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_26uniform(struct __pyx_obj_6mtra
   return __pyx_r;
 }
 
-/* "mtrand.pyx":1320
+/* "mtrand.pyx":1323
  *                            self.lock)
  * 
  *     def rand(self, *args):             # <<<<<<<<<<<<<<
@@ -19263,18 +19326,18 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_28rand(struct __pyx_obj_6mtrand_
   PyObject *__pyx_t_5 = NULL;
   __Pyx_RefNannySetupContext("rand", 0);
 
-  /* "mtrand.pyx":1359
+  /* "mtrand.pyx":1362
  * 
  *         """
  *         if len(args) == 0:             # <<<<<<<<<<<<<<
  *             return self.random_sample()
  *         else:
  */
-  __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1359, __pyx_L1_error)
+  __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1362, __pyx_L1_error)
   __pyx_t_2 = ((__pyx_t_1 == 0) != 0);
   if (__pyx_t_2) {
 
-    /* "mtrand.pyx":1360
+    /* "mtrand.pyx":1363
  *         """
  *         if len(args) == 0:
  *             return self.random_sample()             # <<<<<<<<<<<<<<
@@ -19282,7 +19345,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_28rand(struct __pyx_obj_6mtrand_
  *             return self.random_sample(size=args)
  */
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_random_sample); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1360, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_random_sample); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1363, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __pyx_t_5 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
@@ -19296,14 +19359,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_28rand(struct __pyx_obj_6mtrand_
     }
     __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
-    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1360, __pyx_L1_error)
+    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1363, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __pyx_r = __pyx_t_3;
     __pyx_t_3 = 0;
     goto __pyx_L0;
 
-    /* "mtrand.pyx":1359
+    /* "mtrand.pyx":1362
  * 
  *         """
  *         if len(args) == 0:             # <<<<<<<<<<<<<<
@@ -19312,7 +19375,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_28rand(struct __pyx_obj_6mtrand_
  */
   }
 
-  /* "mtrand.pyx":1362
+  /* "mtrand.pyx":1365
  *             return self.random_sample()
  *         else:
  *             return self.random_sample(size=args)             # <<<<<<<<<<<<<<
@@ -19321,12 +19384,12 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_28rand(struct __pyx_obj_6mtrand_
  */
   /*else*/ {
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_random_sample); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1362, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_random_sample); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1365, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1362, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1365, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
-    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_size, __pyx_v_args) < 0) __PYX_ERR(0, 1362, __pyx_L1_error)
-    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1362, __pyx_L1_error)
+    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_size, __pyx_v_args) < 0) __PYX_ERR(0, 1365, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1365, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
@@ -19335,7 +19398,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_28rand(struct __pyx_obj_6mtrand_
     goto __pyx_L0;
   }
 
-  /* "mtrand.pyx":1320
+  /* "mtrand.pyx":1323
  *                            self.lock)
  * 
  *     def rand(self, *args):             # <<<<<<<<<<<<<<
@@ -19356,7 +19419,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_28rand(struct __pyx_obj_6mtrand_
   return __pyx_r;
 }
 
-/* "mtrand.pyx":1364
+/* "mtrand.pyx":1367
  *             return self.random_sample(size=args)
  * 
  *     def randn(self, *args):             # <<<<<<<<<<<<<<
@@ -19393,18 +19456,18 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_30randn(struct __pyx_obj_6mtrand
   PyObject *__pyx_t_5 = NULL;
   __Pyx_RefNannySetupContext("randn", 0);
 
-  /* "mtrand.pyx":1416
+  /* "mtrand.pyx":1419
  * 
  *         """
  *         if len(args) == 0:             # <<<<<<<<<<<<<<
  *             return self.standard_normal()
  *         else:
  */
-  __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1416, __pyx_L1_error)
+  __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1419, __pyx_L1_error)
   __pyx_t_2 = ((__pyx_t_1 == 0) != 0);
   if (__pyx_t_2) {
 
-    /* "mtrand.pyx":1417
+    /* "mtrand.pyx":1420
  *         """
  *         if len(args) == 0:
  *             return self.standard_normal()             # <<<<<<<<<<<<<<
@@ -19412,7 +19475,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_30randn(struct __pyx_obj_6mtrand
  *             return self.standard_normal(args)
  */
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_standard_normal); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1417, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_standard_normal); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1420, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __pyx_t_5 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
@@ -19426,14 +19489,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_30randn(struct __pyx_obj_6mtrand
     }
     __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
-    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1417, __pyx_L1_error)
+    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1420, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __pyx_r = __pyx_t_3;
     __pyx_t_3 = 0;
     goto __pyx_L0;
 
-    /* "mtrand.pyx":1416
+    /* "mtrand.pyx":1419
  * 
  *         """
  *         if len(args) == 0:             # <<<<<<<<<<<<<<
@@ -19442,7 +19505,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_30randn(struct __pyx_obj_6mtrand
  */
   }
 
-  /* "mtrand.pyx":1419
+  /* "mtrand.pyx":1422
  *             return self.standard_normal()
  *         else:
  *             return self.standard_normal(args)             # <<<<<<<<<<<<<<
@@ -19451,7 +19514,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_30randn(struct __pyx_obj_6mtrand
  */
   /*else*/ {
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_standard_normal); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1419, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_standard_normal); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1422, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __pyx_t_5 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
@@ -19465,7 +19528,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_30randn(struct __pyx_obj_6mtrand
     }
     __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_args) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_args);
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
-    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1419, __pyx_L1_error)
+    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1422, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __pyx_r = __pyx_t_3;
@@ -19473,7 +19536,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_30randn(struct __pyx_obj_6mtrand
     goto __pyx_L0;
   }
 
-  /* "mtrand.pyx":1364
+  /* "mtrand.pyx":1367
  *             return self.random_sample(size=args)
  * 
  *     def randn(self, *args):             # <<<<<<<<<<<<<<
@@ -19494,7 +19557,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_30randn(struct __pyx_obj_6mtrand
   return __pyx_r;
 }
 
-/* "mtrand.pyx":1421
+/* "mtrand.pyx":1424
  *             return self.standard_normal(args)
  * 
  *     def random_integers(self, low, high=None, size=None):             # <<<<<<<<<<<<<<
@@ -19549,7 +19612,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_33random_integers(PyObject *__py
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "random_integers") < 0)) __PYX_ERR(0, 1421, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "random_integers") < 0)) __PYX_ERR(0, 1424, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -19568,7 +19631,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_33random_integers(PyObject *__py
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("random_integers", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1421, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("random_integers", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1424, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("mtrand.RandomState.random_integers", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -19596,7 +19659,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_32random_integers(struct __pyx_o
   __Pyx_INCREF(__pyx_v_low);
   __Pyx_INCREF(__pyx_v_high);
 
-  /* "mtrand.pyx":1501
+  /* "mtrand.pyx":1504
  * 
  *         """
  *         if high is None:             # <<<<<<<<<<<<<<
@@ -19607,37 +19670,37 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_32random_integers(struct __pyx_o
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "mtrand.pyx":1502
+    /* "mtrand.pyx":1505
  *         """
  *         if high is None:
  *             warnings.warn(("This function is deprecated. Please call "             # <<<<<<<<<<<<<<
  *                            "randint(1, {low} + 1) instead".format(low=low)),
  *                           DeprecationWarning)
  */
-    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_warnings); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1502, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_warnings); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1505, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_warn); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1502, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_warn); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1505, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
-    /* "mtrand.pyx":1503
+    /* "mtrand.pyx":1506
  *         if high is None:
  *             warnings.warn(("This function is deprecated. Please call "
  *                            "randint(1, {low} + 1) instead".format(low=low)),             # <<<<<<<<<<<<<<
  *                           DeprecationWarning)
  *             high = low
  */
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_This_function_is_deprecated_Plea, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1503, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_This_function_is_deprecated_Plea, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1506, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1503, __pyx_L1_error)
+    __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1506, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
-    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_low, __pyx_v_low) < 0) __PYX_ERR(0, 1503, __pyx_L1_error)
-    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1503, __pyx_L1_error)
+    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_low, __pyx_v_low) < 0) __PYX_ERR(0, 1506, __pyx_L1_error)
+    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1506, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_7);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
-    /* "mtrand.pyx":1504
+    /* "mtrand.pyx":1507
  *             warnings.warn(("This function is deprecated. Please call "
  *                            "randint(1, {low} + 1) instead".format(low=low)),
  *                           DeprecationWarning)             # <<<<<<<<<<<<<<
@@ -19659,7 +19722,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_32random_integers(struct __pyx_o
     #if CYTHON_FAST_PYCALL
     if (PyFunction_Check(__pyx_t_5)) {
       PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_7, __pyx_builtin_DeprecationWarning};
-      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1502, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1505, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
@@ -19668,14 +19731,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_32random_integers(struct __pyx_o
     #if CYTHON_FAST_PYCCALL
     if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
       PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_7, __pyx_builtin_DeprecationWarning};
-      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1502, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1505, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
     } else
     #endif
     {
-      __pyx_t_4 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1502, __pyx_L1_error)
+      __pyx_t_4 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1505, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       if (__pyx_t_6) {
         __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL;
@@ -19686,14 +19749,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_32random_integers(struct __pyx_o
       __Pyx_GIVEREF(__pyx_builtin_DeprecationWarning);
       PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_8, __pyx_builtin_DeprecationWarning);
       __pyx_t_7 = 0;
-      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1502, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1505, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     }
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
-    /* "mtrand.pyx":1505
+    /* "mtrand.pyx":1508
  *                            "randint(1, {low} + 1) instead".format(low=low)),
  *                           DeprecationWarning)
  *             high = low             # <<<<<<<<<<<<<<
@@ -19703,7 +19766,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_32random_integers(struct __pyx_o
     __Pyx_INCREF(__pyx_v_low);
     __Pyx_DECREF_SET(__pyx_v_high, __pyx_v_low);
 
-    /* "mtrand.pyx":1506
+    /* "mtrand.pyx":1509
  *                           DeprecationWarning)
  *             high = low
  *             low = 1             # <<<<<<<<<<<<<<
@@ -19713,7 +19776,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_32random_integers(struct __pyx_o
     __Pyx_INCREF(__pyx_int_1);
     __Pyx_DECREF_SET(__pyx_v_low, __pyx_int_1);
 
-    /* "mtrand.pyx":1501
+    /* "mtrand.pyx":1504
  * 
  *         """
  *         if high is None:             # <<<<<<<<<<<<<<
@@ -19723,7 +19786,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_32random_integers(struct __pyx_o
     goto __pyx_L3;
   }
 
-  /* "mtrand.pyx":1509
+  /* "mtrand.pyx":1512
  * 
  *         else:
  *             warnings.warn(("This function is deprecated. Please call "             # <<<<<<<<<<<<<<
@@ -19731,47 +19794,47 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_32random_integers(struct __pyx_o
  *                     low=low, high=high)), DeprecationWarning)
  */
   /*else*/ {
-    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_warnings); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1509, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_warnings); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1512, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_warn); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1509, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_warn); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1512, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-    /* "mtrand.pyx":1510
+    /* "mtrand.pyx":1513
  *         else:
  *             warnings.warn(("This function is deprecated. Please call "
  *                            "randint({low}, {high} + 1) instead".format(             # <<<<<<<<<<<<<<
  *                     low=low, high=high)), DeprecationWarning)
  * 
  */
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_This_function_is_deprecated_Plea_2, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1510, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_This_function_is_deprecated_Plea_2, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1513, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
 
-    /* "mtrand.pyx":1511
+    /* "mtrand.pyx":1514
  *             warnings.warn(("This function is deprecated. Please call "
  *                            "randint({low}, {high} + 1) instead".format(
  *                     low=low, high=high)), DeprecationWarning)             # <<<<<<<<<<<<<<
  * 
  *         return self.randint(low, high + 1, size=size, dtype='l')
  */
-    __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1511, __pyx_L1_error)
+    __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1514, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_7);
-    if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_low, __pyx_v_low) < 0) __PYX_ERR(0, 1511, __pyx_L1_error)
-    if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_high, __pyx_v_high) < 0) __PYX_ERR(0, 1511, __pyx_L1_error)
+    if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_low, __pyx_v_low) < 0) __PYX_ERR(0, 1514, __pyx_L1_error)
+    if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_high, __pyx_v_high) < 0) __PYX_ERR(0, 1514, __pyx_L1_error)
 
-    /* "mtrand.pyx":1510
+    /* "mtrand.pyx":1513
  *         else:
  *             warnings.warn(("This function is deprecated. Please call "
  *                            "randint({low}, {high} + 1) instead".format(             # <<<<<<<<<<<<<<
  *                     low=low, high=high)), DeprecationWarning)
  * 
  */
-    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1510, __pyx_L1_error)
+    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1513, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-    /* "mtrand.pyx":1511
+    /* "mtrand.pyx":1514
  *             warnings.warn(("This function is deprecated. Please call "
  *                            "randint({low}, {high} + 1) instead".format(
  *                     low=low, high=high)), DeprecationWarning)             # <<<<<<<<<<<<<<
@@ -19793,7 +19856,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_32random_integers(struct __pyx_o
     #if CYTHON_FAST_PYCALL
     if (PyFunction_Check(__pyx_t_4)) {
       PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_builtin_DeprecationWarning};
-      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1509, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1512, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
@@ -19802,14 +19865,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_32random_integers(struct __pyx_o
     #if CYTHON_FAST_PYCCALL
     if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
       PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_builtin_DeprecationWarning};
-      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1509, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1512, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
     } else
     #endif
     {
-      __pyx_t_5 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1509, __pyx_L1_error)
+      __pyx_t_5 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1512, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
       if (__pyx_t_7) {
         __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
@@ -19820,7 +19883,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_32random_integers(struct __pyx_o
       __Pyx_GIVEREF(__pyx_builtin_DeprecationWarning);
       PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_8, __pyx_builtin_DeprecationWarning);
       __pyx_t_6 = 0;
-      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1509, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1512, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     }
@@ -19829,7 +19892,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_32random_integers(struct __pyx_o
   }
   __pyx_L3:;
 
-  /* "mtrand.pyx":1513
+  /* "mtrand.pyx":1516
  *                     low=low, high=high)), DeprecationWarning)
  * 
  *         return self.randint(low, high + 1, size=size, dtype='l')             # <<<<<<<<<<<<<<
@@ -19837,11 +19900,11 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_32random_integers(struct __pyx_o
  * 
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_randint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1513, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_randint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1516, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_high, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1513, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_high, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1516, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1513, __pyx_L1_error)
+  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1516, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_INCREF(__pyx_v_low);
   __Pyx_GIVEREF(__pyx_v_low);
@@ -19849,11 +19912,11 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_32random_integers(struct __pyx_o
   __Pyx_GIVEREF(__pyx_t_4);
   PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
   __pyx_t_4 = 0;
-  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1513, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1516, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
-  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_size, __pyx_v_size) < 0) __PYX_ERR(0, 1513, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_l) < 0) __PYX_ERR(0, 1513, __pyx_L1_error)
-  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1513, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_size, __pyx_v_size) < 0) __PYX_ERR(0, 1516, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_l) < 0) __PYX_ERR(0, 1516, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1516, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
@@ -19862,7 +19925,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_32random_integers(struct __pyx_o
   __pyx_t_6 = 0;
   goto __pyx_L0;
 
-  /* "mtrand.pyx":1421
+  /* "mtrand.pyx":1424
  *             return self.standard_normal(args)
  * 
  *     def random_integers(self, low, high=None, size=None):             # <<<<<<<<<<<<<<
@@ -19887,7 +19950,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_32random_integers(struct __pyx_o
   return __pyx_r;
 }
 
-/* "mtrand.pyx":1518
+/* "mtrand.pyx":1521
  * 
  *     # Complicated, continuous distributions:
  *     def standard_normal(self, size=None):             # <<<<<<<<<<<<<<
@@ -19925,7 +19988,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_35standard_normal(PyObject *__py
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "standard_normal") < 0)) __PYX_ERR(0, 1518, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "standard_normal") < 0)) __PYX_ERR(0, 1521, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -19939,7 +20002,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_35standard_normal(PyObject *__py
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("standard_normal", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1518, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("standard_normal", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1521, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("mtrand.RandomState.standard_normal", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -19959,7 +20022,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_34standard_normal(struct __pyx_o
   PyObject *__pyx_t_2 = NULL;
   __Pyx_RefNannySetupContext("standard_normal", 0);
 
-  /* "mtrand.pyx":1549
+  /* "mtrand.pyx":1552
  * 
  *         """
  *         return cont0_array(self.internal_state, rk_gauss, size, self.lock)             # <<<<<<<<<<<<<<
@@ -19969,14 +20032,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_34standard_normal(struct __pyx_o
   __Pyx_XDECREF(__pyx_r);
   __pyx_t_1 = __pyx_v_self->lock;
   __Pyx_INCREF(__pyx_t_1);
-  __pyx_t_2 = __pyx_f_6mtrand_cont0_array(__pyx_v_self->internal_state, rk_gauss, __pyx_v_size, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1549, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_6mtrand_cont0_array(__pyx_v_self->internal_state, rk_gauss, __pyx_v_size, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1552, __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;
 
-  /* "mtrand.pyx":1518
+  /* "mtrand.pyx":1521
  * 
  *     # Complicated, continuous distributions:
  *     def standard_normal(self, size=None):             # <<<<<<<<<<<<<<
@@ -19996,7 +20059,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_34standard_normal(struct __pyx_o
   return __pyx_r;
 }
 
-/* "mtrand.pyx":1551
+/* "mtrand.pyx":1554
  *         return cont0_array(self.internal_state, rk_gauss, size, self.lock)
  * 
  *     def normal(self, loc=0.0, scale=1.0, size=None):             # <<<<<<<<<<<<<<
@@ -20054,7 +20117,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_37normal(PyObject *__pyx_v_self,
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "normal") < 0)) __PYX_ERR(0, 1551, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "normal") < 0)) __PYX_ERR(0, 1554, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -20074,7 +20137,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_37normal(PyObject *__pyx_v_self,
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("normal", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1551, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("normal", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1554, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("mtrand.RandomState.normal", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -20103,14 +20166,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_36normal(struct __pyx_obj_6mtran
   PyObject *__pyx_t_7 = NULL;
   __Pyx_RefNannySetupContext("normal", 0);
 
-  /* "mtrand.pyx":1643
+  /* "mtrand.pyx":1646
  *         cdef double floc, fscale
  * 
  *         oloc = <ndarray>PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ARRAY_ALIGNED)             # <<<<<<<<<<<<<<
  *         oscale = <ndarray>PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  */
-  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_loc, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1643, __pyx_L1_error)
+  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_loc, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1646, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_2 = __pyx_t_1;
   __Pyx_INCREF(__pyx_t_2);
@@ -20118,14 +20181,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_36normal(struct __pyx_obj_6mtran
   __pyx_v_oloc = ((PyArrayObject *)__pyx_t_2);
   __pyx_t_2 = 0;
 
-  /* "mtrand.pyx":1644
+  /* "mtrand.pyx":1647
  * 
  *         oloc = <ndarray>PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  *         oscale = <ndarray>PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)             # <<<<<<<<<<<<<<
  * 
  *         if oloc.shape == oscale.shape == ():
  */
-  __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1644, __pyx_L1_error)
+  __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1647, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_1 = __pyx_t_2;
   __Pyx_INCREF(__pyx_t_1);
@@ -20133,61 +20196,61 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_36normal(struct __pyx_obj_6mtran
   __pyx_v_oscale = ((PyArrayObject *)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "mtrand.pyx":1646
+  /* "mtrand.pyx":1649
  *         oscale = <ndarray>PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if oloc.shape == oscale.shape == ():             # <<<<<<<<<<<<<<
  *             floc = PyFloat_AsDouble(loc)
  *             fscale = PyFloat_AsDouble(scale)
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_oloc), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1646, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_oloc), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1649, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_oscale), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1646, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_oscale), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1649, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1646, __pyx_L1_error)
+  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1649, __pyx_L1_error)
   if (__Pyx_PyObject_IsTrue(__pyx_t_3)) {
     __Pyx_DECREF(__pyx_t_3);
-    __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1646, __pyx_L1_error)
+    __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1649, __pyx_L1_error)
   }
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1646, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1649, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   if (__pyx_t_4) {
 
-    /* "mtrand.pyx":1647
+    /* "mtrand.pyx":1650
  * 
  *         if oloc.shape == oscale.shape == ():
  *             floc = PyFloat_AsDouble(loc)             # <<<<<<<<<<<<<<
  *             fscale = PyFloat_AsDouble(scale)
  *             if np.signbit(fscale):
  */
-    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_loc); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 1647, __pyx_L1_error)
+    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_loc); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 1650, __pyx_L1_error)
     __pyx_v_floc = __pyx_t_5;
 
-    /* "mtrand.pyx":1648
+    /* "mtrand.pyx":1651
  *         if oloc.shape == oscale.shape == ():
  *             floc = PyFloat_AsDouble(loc)
  *             fscale = PyFloat_AsDouble(scale)             # <<<<<<<<<<<<<<
  *             if np.signbit(fscale):
  *                 raise ValueError("scale < 0")
  */
-    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_scale); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 1648, __pyx_L1_error)
+    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_scale); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 1651, __pyx_L1_error)
     __pyx_v_fscale = __pyx_t_5;
 
-    /* "mtrand.pyx":1649
+    /* "mtrand.pyx":1652
  *             floc = PyFloat_AsDouble(loc)
  *             fscale = PyFloat_AsDouble(scale)
  *             if np.signbit(fscale):             # <<<<<<<<<<<<<<
  *                 raise ValueError("scale < 0")
  *             return cont2_array_sc(self.internal_state, rk_normal, size, floc,
  */
-    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1649, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1652, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_signbit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1649, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_signbit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1652, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_fscale); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1649, __pyx_L1_error)
+    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_fscale); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1652, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_t_6 = NULL;
     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
@@ -20202,27 +20265,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_36normal(struct __pyx_obj_6mtran
     __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2);
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1649, __pyx_L1_error)
+    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1652, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1649, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1652, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     if (unlikely(__pyx_t_4)) {
 
-      /* "mtrand.pyx":1650
+      /* "mtrand.pyx":1653
  *             fscale = PyFloat_AsDouble(scale)
  *             if np.signbit(fscale):
  *                 raise ValueError("scale < 0")             # <<<<<<<<<<<<<<
  *             return cont2_array_sc(self.internal_state, rk_normal, size, floc,
  *                                   fscale, self.lock)
  */
-      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1650, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1653, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __PYX_ERR(0, 1650, __pyx_L1_error)
+      __PYX_ERR(0, 1653, __pyx_L1_error)
 
-      /* "mtrand.pyx":1649
+      /* "mtrand.pyx":1652
  *             floc = PyFloat_AsDouble(loc)
  *             fscale = PyFloat_AsDouble(scale)
  *             if np.signbit(fscale):             # <<<<<<<<<<<<<<
@@ -20231,7 +20294,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_36normal(struct __pyx_obj_6mtran
  */
     }
 
-    /* "mtrand.pyx":1651
+    /* "mtrand.pyx":1654
  *             if np.signbit(fscale):
  *                 raise ValueError("scale < 0")
  *             return cont2_array_sc(self.internal_state, rk_normal, size, floc,             # <<<<<<<<<<<<<<
@@ -20240,7 +20303,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_36normal(struct __pyx_obj_6mtran
  */
     __Pyx_XDECREF(__pyx_r);
 
-    /* "mtrand.pyx":1652
+    /* "mtrand.pyx":1655
  *                 raise ValueError("scale < 0")
  *             return cont2_array_sc(self.internal_state, rk_normal, size, floc,
  *                                   fscale, self.lock)             # <<<<<<<<<<<<<<
@@ -20250,21 +20313,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_36normal(struct __pyx_obj_6mtran
     __pyx_t_3 = __pyx_v_self->lock;
     __Pyx_INCREF(__pyx_t_3);
 
-    /* "mtrand.pyx":1651
+    /* "mtrand.pyx":1654
  *             if np.signbit(fscale):
  *                 raise ValueError("scale < 0")
  *             return cont2_array_sc(self.internal_state, rk_normal, size, floc,             # <<<<<<<<<<<<<<
  *                                   fscale, self.lock)
  * 
  */
-    __pyx_t_1 = __pyx_f_6mtrand_cont2_array_sc(__pyx_v_self->internal_state, rk_normal, __pyx_v_size, __pyx_v_floc, __pyx_v_fscale, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1651, __pyx_L1_error)
+    __pyx_t_1 = __pyx_f_6mtrand_cont2_array_sc(__pyx_v_self->internal_state, rk_normal, __pyx_v_size, __pyx_v_floc, __pyx_v_fscale, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1654, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __pyx_r = __pyx_t_1;
     __pyx_t_1 = 0;
     goto __pyx_L0;
 
-    /* "mtrand.pyx":1646
+    /* "mtrand.pyx":1649
  *         oscale = <ndarray>PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if oloc.shape == oscale.shape == ():             # <<<<<<<<<<<<<<
@@ -20273,21 +20336,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_36normal(struct __pyx_obj_6mtran
  */
   }
 
-  /* "mtrand.pyx":1654
+  /* "mtrand.pyx":1657
  *                                   fscale, self.lock)
  * 
  *         if np.any(np.signbit(oscale)):             # <<<<<<<<<<<<<<
  *             raise ValueError("scale < 0")
  *         return cont2_array(self.internal_state, rk_normal, size, oloc, oscale,
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1654, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1657, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_any); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1654, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_any); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1657, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1654, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1657, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_signbit); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1654, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_signbit); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1657, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   __pyx_t_6 = NULL;
@@ -20302,7 +20365,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_36normal(struct __pyx_obj_6mtran
   }
   __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_6, ((PyObject *)__pyx_v_oscale)) : __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_v_oscale));
   __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1654, __pyx_L1_error)
+  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1657, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   __pyx_t_7 = NULL;
@@ -20318,27 +20381,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_36normal(struct __pyx_obj_6mtran
   __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
   __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1654, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1657, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1654, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1657, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (unlikely(__pyx_t_4)) {
 
-    /* "mtrand.pyx":1655
+    /* "mtrand.pyx":1658
  * 
  *         if np.any(np.signbit(oscale)):
  *             raise ValueError("scale < 0")             # <<<<<<<<<<<<<<
  *         return cont2_array(self.internal_state, rk_normal, size, oloc, oscale,
  *                            self.lock)
  */
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1655, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1658, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __PYX_ERR(0, 1655, __pyx_L1_error)
+    __PYX_ERR(0, 1658, __pyx_L1_error)
 
-    /* "mtrand.pyx":1654
+    /* "mtrand.pyx":1657
  *                                   fscale, self.lock)
  * 
  *         if np.any(np.signbit(oscale)):             # <<<<<<<<<<<<<<
@@ -20347,7 +20410,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_36normal(struct __pyx_obj_6mtran
  */
   }
 
-  /* "mtrand.pyx":1656
+  /* "mtrand.pyx":1659
  *         if np.any(np.signbit(oscale)):
  *             raise ValueError("scale < 0")
  *         return cont2_array(self.internal_state, rk_normal, size, oloc, oscale,             # <<<<<<<<<<<<<<
@@ -20356,7 +20419,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_36normal(struct __pyx_obj_6mtran
  */
   __Pyx_XDECREF(__pyx_r);
 
-  /* "mtrand.pyx":1657
+  /* "mtrand.pyx":1660
  *             raise ValueError("scale < 0")
  *         return cont2_array(self.internal_state, rk_normal, size, oloc, oscale,
  *                            self.lock)             # <<<<<<<<<<<<<<
@@ -20366,21 +20429,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_36normal(struct __pyx_obj_6mtran
   __pyx_t_1 = __pyx_v_self->lock;
   __Pyx_INCREF(__pyx_t_1);
 
-  /* "mtrand.pyx":1656
+  /* "mtrand.pyx":1659
  *         if np.any(np.signbit(oscale)):
  *             raise ValueError("scale < 0")
  *         return cont2_array(self.internal_state, rk_normal, size, oloc, oscale,             # <<<<<<<<<<<<<<
  *                            self.lock)
  * 
  */
-  __pyx_t_2 = __pyx_f_6mtrand_cont2_array(__pyx_v_self->internal_state, rk_normal, __pyx_v_size, __pyx_v_oloc, __pyx_v_oscale, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1656, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_6mtrand_cont2_array(__pyx_v_self->internal_state, rk_normal, __pyx_v_size, __pyx_v_oloc, __pyx_v_oscale, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1659, __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;
 
-  /* "mtrand.pyx":1551
+  /* "mtrand.pyx":1554
  *         return cont0_array(self.internal_state, rk_gauss, size, self.lock)
  * 
  *     def normal(self, loc=0.0, scale=1.0, size=None):             # <<<<<<<<<<<<<<
@@ -20405,7 +20468,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_36normal(struct __pyx_obj_6mtran
   return __pyx_r;
 }
 
-/* "mtrand.pyx":1659
+/* "mtrand.pyx":1662
  *                            self.lock)
  * 
  *     def beta(self, a, b, size=None):             # <<<<<<<<<<<<<<
@@ -20449,7 +20512,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_39beta(PyObject *__pyx_v_self, P
         case  1:
         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("beta", 0, 2, 3, 1); __PYX_ERR(0, 1659, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("beta", 0, 2, 3, 1); __PYX_ERR(0, 1662, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  2:
@@ -20459,7 +20522,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_39beta(PyObject *__pyx_v_self, P
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "beta") < 0)) __PYX_ERR(0, 1659, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "beta") < 0)) __PYX_ERR(0, 1662, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -20477,7 +20540,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_39beta(PyObject *__pyx_v_self, P
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("beta", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1659, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("beta", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1662, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("mtrand.RandomState.beta", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -20508,14 +20571,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_38beta(struct __pyx_obj_6mtrand_
   PyObject *__pyx_t_9 = NULL;
   __Pyx_RefNannySetupContext("beta", 0);
 
-  /* "mtrand.pyx":1700
+  /* "mtrand.pyx":1703
  *         cdef double fa, fb
  * 
  *         oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ARRAY_ALIGNED)             # <<<<<<<<<<<<<<
  *         ob = <ndarray>PyArray_FROM_OTF(b, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  */
-  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_a, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1700, __pyx_L1_error)
+  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_a, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1703, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_2 = __pyx_t_1;
   __Pyx_INCREF(__pyx_t_2);
@@ -20523,14 +20586,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_38beta(struct __pyx_obj_6mtrand_
   __pyx_v_oa = ((PyArrayObject *)__pyx_t_2);
   __pyx_t_2 = 0;
 
-  /* "mtrand.pyx":1701
+  /* "mtrand.pyx":1704
  * 
  *         oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  *         ob = <ndarray>PyArray_FROM_OTF(b, NPY_DOUBLE, NPY_ARRAY_ALIGNED)             # <<<<<<<<<<<<<<
  * 
  *         if oa.shape == ob.shape == ():
  */
-  __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_b, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1701, __pyx_L1_error)
+  __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_b, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1704, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_1 = __pyx_t_2;
   __Pyx_INCREF(__pyx_t_1);
@@ -20538,49 +20601,49 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_38beta(struct __pyx_obj_6mtrand_
   __pyx_v_ob = ((PyArrayObject *)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "mtrand.pyx":1703
+  /* "mtrand.pyx":1706
  *         ob = <ndarray>PyArray_FROM_OTF(b, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if oa.shape == ob.shape == ():             # <<<<<<<<<<<<<<
  *             fa = PyFloat_AsDouble(a)
  *             fb = PyFloat_AsDouble(b)
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_oa), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1703, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_oa), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1706, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ob), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1703, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ob), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1706, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1703, __pyx_L1_error)
+  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1706, __pyx_L1_error)
   if (__Pyx_PyObject_IsTrue(__pyx_t_3)) {
     __Pyx_DECREF(__pyx_t_3);
-    __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1703, __pyx_L1_error)
+    __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1706, __pyx_L1_error)
   }
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1703, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1706, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   if (__pyx_t_4) {
 
-    /* "mtrand.pyx":1704
+    /* "mtrand.pyx":1707
  * 
  *         if oa.shape == ob.shape == ():
  *             fa = PyFloat_AsDouble(a)             # <<<<<<<<<<<<<<
  *             fb = PyFloat_AsDouble(b)
  * 
  */
-    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_a); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 1704, __pyx_L1_error)
+    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_a); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 1707, __pyx_L1_error)
     __pyx_v_fa = __pyx_t_5;
 
-    /* "mtrand.pyx":1705
+    /* "mtrand.pyx":1708
  *         if oa.shape == ob.shape == ():
  *             fa = PyFloat_AsDouble(a)
  *             fb = PyFloat_AsDouble(b)             # <<<<<<<<<<<<<<
  * 
  *             if fa <= 0:
  */
-    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_b); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 1705, __pyx_L1_error)
+    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_b); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 1708, __pyx_L1_error)
     __pyx_v_fb = __pyx_t_5;
 
-    /* "mtrand.pyx":1707
+    /* "mtrand.pyx":1710
  *             fb = PyFloat_AsDouble(b)
  * 
  *             if fa <= 0:             # <<<<<<<<<<<<<<
@@ -20590,20 +20653,20 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_38beta(struct __pyx_obj_6mtrand_
     __pyx_t_4 = ((__pyx_v_fa <= 0.0) != 0);
     if (unlikely(__pyx_t_4)) {
 
-      /* "mtrand.pyx":1708
+      /* "mtrand.pyx":1711
  * 
  *             if fa <= 0:
  *                 raise ValueError("a <= 0")             # <<<<<<<<<<<<<<
  *             if fb <= 0:
  *                 raise ValueError("b <= 0")
  */
-      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1708, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1711, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __PYX_ERR(0, 1708, __pyx_L1_error)
+      __PYX_ERR(0, 1711, __pyx_L1_error)
 
-      /* "mtrand.pyx":1707
+      /* "mtrand.pyx":1710
  *             fb = PyFloat_AsDouble(b)
  * 
  *             if fa <= 0:             # <<<<<<<<<<<<<<
@@ -20612,7 +20675,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_38beta(struct __pyx_obj_6mtrand_
  */
     }
 
-    /* "mtrand.pyx":1709
+    /* "mtrand.pyx":1712
  *             if fa <= 0:
  *                 raise ValueError("a <= 0")
  *             if fb <= 0:             # <<<<<<<<<<<<<<
@@ -20622,20 +20685,20 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_38beta(struct __pyx_obj_6mtrand_
     __pyx_t_4 = ((__pyx_v_fb <= 0.0) != 0);
     if (unlikely(__pyx_t_4)) {
 
-      /* "mtrand.pyx":1710
+      /* "mtrand.pyx":1713
  *                 raise ValueError("a <= 0")
  *             if fb <= 0:
  *                 raise ValueError("b <= 0")             # <<<<<<<<<<<<<<
  *             return cont2_array_sc(self.internal_state, rk_beta, size, fa, fb,
  *                                   self.lock)
  */
-      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1710, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1713, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __PYX_ERR(0, 1710, __pyx_L1_error)
+      __PYX_ERR(0, 1713, __pyx_L1_error)
 
-      /* "mtrand.pyx":1709
+      /* "mtrand.pyx":1712
  *             if fa <= 0:
  *                 raise ValueError("a <= 0")
  *             if fb <= 0:             # <<<<<<<<<<<<<<
@@ -20644,7 +20707,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_38beta(struct __pyx_obj_6mtrand_
  */
     }
 
-    /* "mtrand.pyx":1711
+    /* "mtrand.pyx":1714
  *             if fb <= 0:
  *                 raise ValueError("b <= 0")
  *             return cont2_array_sc(self.internal_state, rk_beta, size, fa, fb,             # <<<<<<<<<<<<<<
@@ -20653,7 +20716,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_38beta(struct __pyx_obj_6mtrand_
  */
     __Pyx_XDECREF(__pyx_r);
 
-    /* "mtrand.pyx":1712
+    /* "mtrand.pyx":1715
  *                 raise ValueError("b <= 0")
  *             return cont2_array_sc(self.internal_state, rk_beta, size, fa, fb,
  *                                   self.lock)             # <<<<<<<<<<<<<<
@@ -20663,21 +20726,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_38beta(struct __pyx_obj_6mtrand_
     __pyx_t_3 = __pyx_v_self->lock;
     __Pyx_INCREF(__pyx_t_3);
 
-    /* "mtrand.pyx":1711
+    /* "mtrand.pyx":1714
  *             if fb <= 0:
  *                 raise ValueError("b <= 0")
  *             return cont2_array_sc(self.internal_state, rk_beta, size, fa, fb,             # <<<<<<<<<<<<<<
  *                                   self.lock)
  * 
  */
-    __pyx_t_2 = __pyx_f_6mtrand_cont2_array_sc(__pyx_v_self->internal_state, rk_beta, __pyx_v_size, __pyx_v_fa, __pyx_v_fb, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1711, __pyx_L1_error)
+    __pyx_t_2 = __pyx_f_6mtrand_cont2_array_sc(__pyx_v_self->internal_state, rk_beta, __pyx_v_size, __pyx_v_fa, __pyx_v_fb, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1714, __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;
 
-    /* "mtrand.pyx":1703
+    /* "mtrand.pyx":1706
  *         ob = <ndarray>PyArray_FROM_OTF(b, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if oa.shape == ob.shape == ():             # <<<<<<<<<<<<<<
@@ -20686,21 +20749,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_38beta(struct __pyx_obj_6mtrand_
  */
   }
 
-  /* "mtrand.pyx":1714
+  /* "mtrand.pyx":1717
  *                                   self.lock)
  * 
  *         if np.any(np.less_equal(oa, 0)):             # <<<<<<<<<<<<<<
  *             raise ValueError("a <= 0")
  *         if np.any(np.less_equal(ob, 0)):
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1714, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1717, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_any); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1714, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_any); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1717, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1714, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1717, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_less_equal); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1714, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_less_equal); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1717, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   __pyx_t_6 = NULL;
@@ -20718,7 +20781,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_38beta(struct __pyx_obj_6mtrand_
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_7)) {
     PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_v_oa), __pyx_int_0};
-    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1714, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1717, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_GOTREF(__pyx_t_3);
   } else
@@ -20726,13 +20789,13 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_38beta(struct __pyx_obj_6mtrand_
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
     PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_v_oa), __pyx_int_0};
-    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1714, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1717, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_GOTREF(__pyx_t_3);
   } else
   #endif
   {
-    __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1714, __pyx_L1_error)
+    __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1717, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_9);
     if (__pyx_t_6) {
       __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL;
@@ -20743,7 +20806,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_38beta(struct __pyx_obj_6mtrand_
     __Pyx_INCREF(__pyx_int_0);
     __Pyx_GIVEREF(__pyx_int_0);
     PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_int_0);
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1714, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1717, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
   }
@@ -20761,27 +20824,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_38beta(struct __pyx_obj_6mtrand_
   __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_7, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3);
   __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1714, __pyx_L1_error)
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1717, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1714, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1717, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (unlikely(__pyx_t_4)) {
 
-    /* "mtrand.pyx":1715
+    /* "mtrand.pyx":1718
  * 
  *         if np.any(np.less_equal(oa, 0)):
  *             raise ValueError("a <= 0")             # <<<<<<<<<<<<<<
  *         if np.any(np.less_equal(ob, 0)):
  *             raise ValueError("b <= 0")
  */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1715, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1718, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __PYX_ERR(0, 1715, __pyx_L1_error)
+    __PYX_ERR(0, 1718, __pyx_L1_error)
 
-    /* "mtrand.pyx":1714
+    /* "mtrand.pyx":1717
  *                                   self.lock)
  * 
  *         if np.any(np.less_equal(oa, 0)):             # <<<<<<<<<<<<<<
@@ -20790,21 +20853,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_38beta(struct __pyx_obj_6mtrand_
  */
   }
 
-  /* "mtrand.pyx":1716
+  /* "mtrand.pyx":1719
  *         if np.any(np.less_equal(oa, 0)):
  *             raise ValueError("a <= 0")
  *         if np.any(np.less_equal(ob, 0)):             # <<<<<<<<<<<<<<
  *             raise ValueError("b <= 0")
  *         return cont2_array(self.internal_state, rk_beta, size, oa, ob,
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1716, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1719, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_any); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1716, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_any); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1719, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1716, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1719, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_less_equal); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1716, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_less_equal); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1719, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   __pyx_t_7 = NULL;
@@ -20822,7 +20885,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_38beta(struct __pyx_obj_6mtrand_
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_9)) {
     PyObject *__pyx_temp[3] = {__pyx_t_7, ((PyObject *)__pyx_v_ob), __pyx_int_0};
-    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1716, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1719, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
@@ -20830,13 +20893,13 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_38beta(struct __pyx_obj_6mtrand_
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
     PyObject *__pyx_temp[3] = {__pyx_t_7, ((PyObject *)__pyx_v_ob), __pyx_int_0};
-    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1716, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1719, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
   #endif
   {
-    __pyx_t_6 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1716, __pyx_L1_error)
+    __pyx_t_6 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1719, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     if (__pyx_t_7) {
       __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = NULL;
@@ -20847,7 +20910,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_38beta(struct __pyx_obj_6mtrand_
     __Pyx_INCREF(__pyx_int_0);
     __Pyx_GIVEREF(__pyx_int_0);
     PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_int_0);
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1716, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1719, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   }
@@ -20865,27 +20928,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_38beta(struct __pyx_obj_6mtrand_
   __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_9, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1);
   __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1716, __pyx_L1_error)
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1719, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1716, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1719, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (unlikely(__pyx_t_4)) {
 
-    /* "mtrand.pyx":1717
+    /* "mtrand.pyx":1720
  *             raise ValueError("a <= 0")
  *         if np.any(np.less_equal(ob, 0)):
  *             raise ValueError("b <= 0")             # <<<<<<<<<<<<<<
  *         return cont2_array(self.internal_state, rk_beta, size, oa, ob,
  *                            self.lock)
  */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1717, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1720, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __PYX_ERR(0, 1717, __pyx_L1_error)
+    __PYX_ERR(0, 1720, __pyx_L1_error)
 
-    /* "mtrand.pyx":1716
+    /* "mtrand.pyx":1719
  *         if np.any(np.less_equal(oa, 0)):
  *             raise ValueError("a <= 0")
  *         if np.any(np.less_equal(ob, 0)):             # <<<<<<<<<<<<<<
@@ -20894,7 +20957,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_38beta(struct __pyx_obj_6mtrand_
  */
   }
 
-  /* "mtrand.pyx":1718
+  /* "mtrand.pyx":1721
  *         if np.any(np.less_equal(ob, 0)):
  *             raise ValueError("b <= 0")
  *         return cont2_array(self.internal_state, rk_beta, size, oa, ob,             # <<<<<<<<<<<<<<
@@ -20903,7 +20966,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_38beta(struct __pyx_obj_6mtrand_
  */
   __Pyx_XDECREF(__pyx_r);
 
-  /* "mtrand.pyx":1719
+  /* "mtrand.pyx":1722
  *             raise ValueError("b <= 0")
  *         return cont2_array(self.internal_state, rk_beta, size, oa, ob,
  *                            self.lock)             # <<<<<<<<<<<<<<
@@ -20913,21 +20976,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_38beta(struct __pyx_obj_6mtrand_
   __pyx_t_2 = __pyx_v_self->lock;
   __Pyx_INCREF(__pyx_t_2);
 
-  /* "mtrand.pyx":1718
+  /* "mtrand.pyx":1721
  *         if np.any(np.less_equal(ob, 0)):
  *             raise ValueError("b <= 0")
  *         return cont2_array(self.internal_state, rk_beta, size, oa, ob,             # <<<<<<<<<<<<<<
  *                            self.lock)
  * 
  */
-  __pyx_t_3 = __pyx_f_6mtrand_cont2_array(__pyx_v_self->internal_state, rk_beta, __pyx_v_size, __pyx_v_oa, __pyx_v_ob, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1718, __pyx_L1_error)
+  __pyx_t_3 = __pyx_f_6mtrand_cont2_array(__pyx_v_self->internal_state, rk_beta, __pyx_v_size, __pyx_v_oa, __pyx_v_ob, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1721, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_r = __pyx_t_3;
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  /* "mtrand.pyx":1659
+  /* "mtrand.pyx":1662
  *                            self.lock)
  * 
  *     def beta(self, a, b, size=None):             # <<<<<<<<<<<<<<
@@ -20953,7 +21016,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_38beta(struct __pyx_obj_6mtrand_
   return __pyx_r;
 }
 
-/* "mtrand.pyx":1721
+/* "mtrand.pyx":1724
  *                            self.lock)
  * 
  *     def exponential(self, scale=1.0, size=None):             # <<<<<<<<<<<<<<
@@ -21001,7 +21064,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_41exponential(PyObject *__pyx_v_
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "exponential") < 0)) __PYX_ERR(0, 1721, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "exponential") < 0)) __PYX_ERR(0, 1724, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -21018,7 +21081,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_41exponential(PyObject *__pyx_v_
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("exponential", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1721, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("exponential", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1724, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("mtrand.RandomState.exponential", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -21045,14 +21108,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_40exponential(struct __pyx_obj_6
   PyObject *__pyx_t_7 = NULL;
   __Pyx_RefNannySetupContext("exponential", 0);
 
-  /* "mtrand.pyx":1769
+  /* "mtrand.pyx":1772
  *         cdef double fscale
  * 
  *         oscale = <ndarray>PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)             # <<<<<<<<<<<<<<
  * 
  *         if oscale.shape == ():
  */
-  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1769, __pyx_L1_error)
+  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1772, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_2 = __pyx_t_1;
   __Pyx_INCREF(__pyx_t_2);
@@ -21060,44 +21123,44 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_40exponential(struct __pyx_obj_6
   __pyx_v_oscale = ((PyArrayObject *)__pyx_t_2);
   __pyx_t_2 = 0;
 
-  /* "mtrand.pyx":1771
+  /* "mtrand.pyx":1774
  *         oscale = <ndarray>PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if oscale.shape == ():             # <<<<<<<<<<<<<<
  *             fscale = PyFloat_AsDouble(scale)
  *             if np.signbit(fscale):
  */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_oscale), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1771, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_oscale), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1774, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1771, __pyx_L1_error)
+  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1774, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1771, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1774, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (__pyx_t_3) {
 
-    /* "mtrand.pyx":1772
+    /* "mtrand.pyx":1775
  * 
  *         if oscale.shape == ():
  *             fscale = PyFloat_AsDouble(scale)             # <<<<<<<<<<<<<<
  *             if np.signbit(fscale):
  *                 raise ValueError("scale < 0")
  */
-    __pyx_t_4 = PyFloat_AsDouble(__pyx_v_scale); if (unlikely(__pyx_t_4 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 1772, __pyx_L1_error)
+    __pyx_t_4 = PyFloat_AsDouble(__pyx_v_scale); if (unlikely(__pyx_t_4 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 1775, __pyx_L1_error)
     __pyx_v_fscale = __pyx_t_4;
 
-    /* "mtrand.pyx":1773
+    /* "mtrand.pyx":1776
  *         if oscale.shape == ():
  *             fscale = PyFloat_AsDouble(scale)
  *             if np.signbit(fscale):             # <<<<<<<<<<<<<<
  *                 raise ValueError("scale < 0")
  *             return cont1_array_sc(self.internal_state, rk_exponential, size,
  */
-    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1773, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1776, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_signbit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1773, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_signbit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1776, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_fscale); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1773, __pyx_L1_error)
+    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_fscale); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1776, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_t_6 = NULL;
     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
@@ -21112,27 +21175,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_40exponential(struct __pyx_obj_6
     __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2);
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1773, __pyx_L1_error)
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1776, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1773, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1776, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     if (unlikely(__pyx_t_3)) {
 
-      /* "mtrand.pyx":1774
+      /* "mtrand.pyx":1777
  *             fscale = PyFloat_AsDouble(scale)
  *             if np.signbit(fscale):
  *                 raise ValueError("scale < 0")             # <<<<<<<<<<<<<<
  *             return cont1_array_sc(self.internal_state, rk_exponential, size,
  *                                   fscale, self.lock)
  */
-      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1774, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1777, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_Raise(__pyx_t_1, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __PYX_ERR(0, 1774, __pyx_L1_error)
+      __PYX_ERR(0, 1777, __pyx_L1_error)
 
-      /* "mtrand.pyx":1773
+      /* "mtrand.pyx":1776
  *         if oscale.shape == ():
  *             fscale = PyFloat_AsDouble(scale)
  *             if np.signbit(fscale):             # <<<<<<<<<<<<<<
@@ -21141,7 +21204,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_40exponential(struct __pyx_obj_6
  */
     }
 
-    /* "mtrand.pyx":1775
+    /* "mtrand.pyx":1778
  *             if np.signbit(fscale):
  *                 raise ValueError("scale < 0")
  *             return cont1_array_sc(self.internal_state, rk_exponential, size,             # <<<<<<<<<<<<<<
@@ -21150,7 +21213,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_40exponential(struct __pyx_obj_6
  */
     __Pyx_XDECREF(__pyx_r);
 
-    /* "mtrand.pyx":1776
+    /* "mtrand.pyx":1779
  *                 raise ValueError("scale < 0")
  *             return cont1_array_sc(self.internal_state, rk_exponential, size,
  *                                   fscale, self.lock)             # <<<<<<<<<<<<<<
@@ -21160,21 +21223,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_40exponential(struct __pyx_obj_6
     __pyx_t_1 = __pyx_v_self->lock;
     __Pyx_INCREF(__pyx_t_1);
 
-    /* "mtrand.pyx":1775
+    /* "mtrand.pyx":1778
  *             if np.signbit(fscale):
  *                 raise ValueError("scale < 0")
  *             return cont1_array_sc(self.internal_state, rk_exponential, size,             # <<<<<<<<<<<<<<
  *                                   fscale, self.lock)
  * 
  */
-    __pyx_t_5 = __pyx_f_6mtrand_cont1_array_sc(__pyx_v_self->internal_state, rk_exponential, __pyx_v_size, __pyx_v_fscale, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1775, __pyx_L1_error)
+    __pyx_t_5 = __pyx_f_6mtrand_cont1_array_sc(__pyx_v_self->internal_state, rk_exponential, __pyx_v_size, __pyx_v_fscale, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1778, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __pyx_r = __pyx_t_5;
     __pyx_t_5 = 0;
     goto __pyx_L0;
 
-    /* "mtrand.pyx":1771
+    /* "mtrand.pyx":1774
  *         oscale = <ndarray>PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if oscale.shape == ():             # <<<<<<<<<<<<<<
@@ -21183,21 +21246,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_40exponential(struct __pyx_obj_6
  */
   }
 
-  /* "mtrand.pyx":1778
+  /* "mtrand.pyx":1781
  *                                   fscale, self.lock)
  * 
  *         if np.any(np.signbit(oscale)):             # <<<<<<<<<<<<<<
  *             raise ValueError("scale < 0")
  *         return cont1_array(self.internal_state, rk_exponential, size, oscale,
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1778, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1781, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_any); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1778, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_any); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1781, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1778, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1781, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_signbit); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1778, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_signbit); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1781, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   __pyx_t_6 = NULL;
@@ -21212,7 +21275,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_40exponential(struct __pyx_obj_6
   }
   __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_6, ((PyObject *)__pyx_v_oscale)) : __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_v_oscale));
   __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1778, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1781, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   __pyx_t_7 = NULL;
@@ -21228,27 +21291,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_40exponential(struct __pyx_obj_6
   __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1);
   __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1778, __pyx_L1_error)
+  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1781, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1778, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1781, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   if (unlikely(__pyx_t_3)) {
 
-    /* "mtrand.pyx":1779
+    /* "mtrand.pyx":1782
  * 
  *         if np.any(np.signbit(oscale)):
  *             raise ValueError("scale < 0")             # <<<<<<<<<<<<<<
  *         return cont1_array(self.internal_state, rk_exponential, size, oscale,
  *                            self.lock)
  */
-    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1779, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1782, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_Raise(__pyx_t_5, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __PYX_ERR(0, 1779, __pyx_L1_error)
+    __PYX_ERR(0, 1782, __pyx_L1_error)
 
-    /* "mtrand.pyx":1778
+    /* "mtrand.pyx":1781
  *                                   fscale, self.lock)
  * 
  *         if np.any(np.signbit(oscale)):             # <<<<<<<<<<<<<<
@@ -21257,7 +21320,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_40exponential(struct __pyx_obj_6
  */
   }
 
-  /* "mtrand.pyx":1780
+  /* "mtrand.pyx":1783
  *         if np.any(np.signbit(oscale)):
  *             raise ValueError("scale < 0")
  *         return cont1_array(self.internal_state, rk_exponential, size, oscale,             # <<<<<<<<<<<<<<
@@ -21266,7 +21329,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_40exponential(struct __pyx_obj_6
  */
   __Pyx_XDECREF(__pyx_r);
 
-  /* "mtrand.pyx":1781
+  /* "mtrand.pyx":1784
  *             raise ValueError("scale < 0")
  *         return cont1_array(self.internal_state, rk_exponential, size, oscale,
  *                            self.lock)             # <<<<<<<<<<<<<<
@@ -21276,21 +21339,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_40exponential(struct __pyx_obj_6
   __pyx_t_5 = __pyx_v_self->lock;
   __Pyx_INCREF(__pyx_t_5);
 
-  /* "mtrand.pyx":1780
+  /* "mtrand.pyx":1783
  *         if np.any(np.signbit(oscale)):
  *             raise ValueError("scale < 0")
  *         return cont1_array(self.internal_state, rk_exponential, size, oscale,             # <<<<<<<<<<<<<<
  *                            self.lock)
  * 
  */
-  __pyx_t_2 = __pyx_f_6mtrand_cont1_array(__pyx_v_self->internal_state, rk_exponential, __pyx_v_size, __pyx_v_oscale, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1780, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_6mtrand_cont1_array(__pyx_v_self->internal_state, rk_exponential, __pyx_v_size, __pyx_v_oscale, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1783, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   __pyx_r = __pyx_t_2;
   __pyx_t_2 = 0;
   goto __pyx_L0;
 
-  /* "mtrand.pyx":1721
+  /* "mtrand.pyx":1724
  *                            self.lock)
  * 
  *     def exponential(self, scale=1.0, size=None):             # <<<<<<<<<<<<<<
@@ -21314,7 +21377,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_40exponential(struct __pyx_obj_6
   return __pyx_r;
 }
 
-/* "mtrand.pyx":1783
+/* "mtrand.pyx":1786
  *                            self.lock)
  * 
  *     def standard_exponential(self, size=None):             # <<<<<<<<<<<<<<
@@ -21352,7 +21415,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_43standard_exponential(PyObject
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "standard_exponential") < 0)) __PYX_ERR(0, 1783, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "standard_exponential") < 0)) __PYX_ERR(0, 1786, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -21366,7 +21429,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_43standard_exponential(PyObject
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("standard_exponential", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1783, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("standard_exponential", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1786, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("mtrand.RandomState.standard_exponential", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -21386,7 +21449,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_42standard_exponential(struct __
   PyObject *__pyx_t_2 = NULL;
   __Pyx_RefNannySetupContext("standard_exponential", 0);
 
-  /* "mtrand.pyx":1811
+  /* "mtrand.pyx":1814
  * 
  *         """
  *         return cont0_array(self.internal_state, rk_standard_exponential, size,             # <<<<<<<<<<<<<<
@@ -21395,7 +21458,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_42standard_exponential(struct __
  */
   __Pyx_XDECREF(__pyx_r);
 
-  /* "mtrand.pyx":1812
+  /* "mtrand.pyx":1815
  *         """
  *         return cont0_array(self.internal_state, rk_standard_exponential, size,
  *                            self.lock)             # <<<<<<<<<<<<<<
@@ -21405,21 +21468,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_42standard_exponential(struct __
   __pyx_t_1 = __pyx_v_self->lock;
   __Pyx_INCREF(__pyx_t_1);
 
-  /* "mtrand.pyx":1811
+  /* "mtrand.pyx":1814
  * 
  *         """
  *         return cont0_array(self.internal_state, rk_standard_exponential, size,             # <<<<<<<<<<<<<<
  *                            self.lock)
  * 
  */
-  __pyx_t_2 = __pyx_f_6mtrand_cont0_array(__pyx_v_self->internal_state, rk_standard_exponential, __pyx_v_size, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1811, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_6mtrand_cont0_array(__pyx_v_self->internal_state, rk_standard_exponential, __pyx_v_size, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1814, __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;
 
-  /* "mtrand.pyx":1783
+  /* "mtrand.pyx":1786
  *                            self.lock)
  * 
  *     def standard_exponential(self, size=None):             # <<<<<<<<<<<<<<
@@ -21439,7 +21502,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_42standard_exponential(struct __
   return __pyx_r;
 }
 
-/* "mtrand.pyx":1814
+/* "mtrand.pyx":1817
  *                            self.lock)
  * 
  *     def standard_gamma(self, shape, size=None):             # <<<<<<<<<<<<<<
@@ -21484,7 +21547,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_45standard_gamma(PyObject *__pyx
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "standard_gamma") < 0)) __PYX_ERR(0, 1814, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "standard_gamma") < 0)) __PYX_ERR(0, 1817, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -21500,7 +21563,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_45standard_gamma(PyObject *__pyx
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("standard_gamma", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1814, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("standard_gamma", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1817, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("mtrand.RandomState.standard_gamma", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -21527,14 +21590,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_44standard_gamma(struct __pyx_ob
   PyObject *__pyx_t_7 = NULL;
   __Pyx_RefNannySetupContext("standard_gamma", 0);
 
-  /* "mtrand.pyx":1886
+  /* "mtrand.pyx":1889
  *         cdef double fshape
  * 
  *         oshape = <ndarray>PyArray_FROM_OTF(shape, NPY_DOUBLE, NPY_ARRAY_ALIGNED)             # <<<<<<<<<<<<<<
  * 
  *         if oshape.shape == ():
  */
-  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_shape, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1886, __pyx_L1_error)
+  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_shape, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1889, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_2 = __pyx_t_1;
   __Pyx_INCREF(__pyx_t_2);
@@ -21542,44 +21605,44 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_44standard_gamma(struct __pyx_ob
   __pyx_v_oshape = ((PyArrayObject *)__pyx_t_2);
   __pyx_t_2 = 0;
 
-  /* "mtrand.pyx":1888
+  /* "mtrand.pyx":1891
  *         oshape = <ndarray>PyArray_FROM_OTF(shape, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if oshape.shape == ():             # <<<<<<<<<<<<<<
  *             fshape = PyFloat_AsDouble(shape)
  *             if np.signbit(fshape):
  */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_oshape), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1888, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_oshape), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1891, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1888, __pyx_L1_error)
+  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1891, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1888, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1891, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (__pyx_t_3) {
 
-    /* "mtrand.pyx":1889
+    /* "mtrand.pyx":1892
  * 
  *         if oshape.shape == ():
  *             fshape = PyFloat_AsDouble(shape)             # <<<<<<<<<<<<<<
  *             if np.signbit(fshape):
  *                 raise ValueError("shape < 0")
  */
-    __pyx_t_4 = PyFloat_AsDouble(__pyx_v_shape); if (unlikely(__pyx_t_4 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 1889, __pyx_L1_error)
+    __pyx_t_4 = PyFloat_AsDouble(__pyx_v_shape); if (unlikely(__pyx_t_4 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 1892, __pyx_L1_error)
     __pyx_v_fshape = __pyx_t_4;
 
-    /* "mtrand.pyx":1890
+    /* "mtrand.pyx":1893
  *         if oshape.shape == ():
  *             fshape = PyFloat_AsDouble(shape)
  *             if np.signbit(fshape):             # <<<<<<<<<<<<<<
  *                 raise ValueError("shape < 0")
  *             return cont1_array_sc(self.internal_state, rk_standard_gamma,
  */
-    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1890, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1893, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_signbit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1890, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_signbit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1893, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_fshape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1890, __pyx_L1_error)
+    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_fshape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1893, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_t_6 = NULL;
     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
@@ -21594,27 +21657,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_44standard_gamma(struct __pyx_ob
     __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2);
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1890, __pyx_L1_error)
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1893, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1890, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1893, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     if (unlikely(__pyx_t_3)) {
 
-      /* "mtrand.pyx":1891
+      /* "mtrand.pyx":1894
  *             fshape = PyFloat_AsDouble(shape)
  *             if np.signbit(fshape):
  *                 raise ValueError("shape < 0")             # <<<<<<<<<<<<<<
  *             return cont1_array_sc(self.internal_state, rk_standard_gamma,
  *                                   size, fshape, self.lock)
  */
-      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1891, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1894, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_Raise(__pyx_t_1, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __PYX_ERR(0, 1891, __pyx_L1_error)
+      __PYX_ERR(0, 1894, __pyx_L1_error)
 
-      /* "mtrand.pyx":1890
+      /* "mtrand.pyx":1893
  *         if oshape.shape == ():
  *             fshape = PyFloat_AsDouble(shape)
  *             if np.signbit(fshape):             # <<<<<<<<<<<<<<
@@ -21623,7 +21686,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_44standard_gamma(struct __pyx_ob
  */
     }
 
-    /* "mtrand.pyx":1892
+    /* "mtrand.pyx":1895
  *             if np.signbit(fshape):
  *                 raise ValueError("shape < 0")
  *             return cont1_array_sc(self.internal_state, rk_standard_gamma,             # <<<<<<<<<<<<<<
@@ -21632,7 +21695,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_44standard_gamma(struct __pyx_ob
  */
     __Pyx_XDECREF(__pyx_r);
 
-    /* "mtrand.pyx":1893
+    /* "mtrand.pyx":1896
  *                 raise ValueError("shape < 0")
  *             return cont1_array_sc(self.internal_state, rk_standard_gamma,
  *                                   size, fshape, self.lock)             # <<<<<<<<<<<<<<
@@ -21642,21 +21705,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_44standard_gamma(struct __pyx_ob
     __pyx_t_1 = __pyx_v_self->lock;
     __Pyx_INCREF(__pyx_t_1);
 
-    /* "mtrand.pyx":1892
+    /* "mtrand.pyx":1895
  *             if np.signbit(fshape):
  *                 raise ValueError("shape < 0")
  *             return cont1_array_sc(self.internal_state, rk_standard_gamma,             # <<<<<<<<<<<<<<
  *                                   size, fshape, self.lock)
  * 
  */
-    __pyx_t_5 = __pyx_f_6mtrand_cont1_array_sc(__pyx_v_self->internal_state, rk_standard_gamma, __pyx_v_size, __pyx_v_fshape, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1892, __pyx_L1_error)
+    __pyx_t_5 = __pyx_f_6mtrand_cont1_array_sc(__pyx_v_self->internal_state, rk_standard_gamma, __pyx_v_size, __pyx_v_fshape, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1895, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __pyx_r = __pyx_t_5;
     __pyx_t_5 = 0;
     goto __pyx_L0;
 
-    /* "mtrand.pyx":1888
+    /* "mtrand.pyx":1891
  *         oshape = <ndarray>PyArray_FROM_OTF(shape, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if oshape.shape == ():             # <<<<<<<<<<<<<<
@@ -21665,21 +21728,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_44standard_gamma(struct __pyx_ob
  */
   }
 
-  /* "mtrand.pyx":1895
+  /* "mtrand.pyx":1898
  *                                   size, fshape, self.lock)
  * 
  *         if np.any(np.signbit(oshape)):             # <<<<<<<<<<<<<<
  *             raise ValueError("shape < 0")
  *         return cont1_array(self.internal_state, rk_standard_gamma, size,
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1895, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1898, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_any); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1895, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_any); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1898, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1895, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1898, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_signbit); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1895, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_signbit); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1898, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   __pyx_t_6 = NULL;
@@ -21694,7 +21757,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_44standard_gamma(struct __pyx_ob
   }
   __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_6, ((PyObject *)__pyx_v_oshape)) : __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_v_oshape));
   __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1895, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1898, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   __pyx_t_7 = NULL;
@@ -21710,27 +21773,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_44standard_gamma(struct __pyx_ob
   __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1);
   __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1895, __pyx_L1_error)
+  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1898, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1895, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1898, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   if (unlikely(__pyx_t_3)) {
 
-    /* "mtrand.pyx":1896
+    /* "mtrand.pyx":1899
  * 
  *         if np.any(np.signbit(oshape)):
  *             raise ValueError("shape < 0")             # <<<<<<<<<<<<<<
  *         return cont1_array(self.internal_state, rk_standard_gamma, size,
  *                            oshape, self.lock)
  */
-    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1896, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1899, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_Raise(__pyx_t_5, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __PYX_ERR(0, 1896, __pyx_L1_error)
+    __PYX_ERR(0, 1899, __pyx_L1_error)
 
-    /* "mtrand.pyx":1895
+    /* "mtrand.pyx":1898
  *                                   size, fshape, self.lock)
  * 
  *         if np.any(np.signbit(oshape)):             # <<<<<<<<<<<<<<
@@ -21739,7 +21802,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_44standard_gamma(struct __pyx_ob
  */
   }
 
-  /* "mtrand.pyx":1897
+  /* "mtrand.pyx":1900
  *         if np.any(np.signbit(oshape)):
  *             raise ValueError("shape < 0")
  *         return cont1_array(self.internal_state, rk_standard_gamma, size,             # <<<<<<<<<<<<<<
@@ -21748,7 +21811,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_44standard_gamma(struct __pyx_ob
  */
   __Pyx_XDECREF(__pyx_r);
 
-  /* "mtrand.pyx":1898
+  /* "mtrand.pyx":1901
  *             raise ValueError("shape < 0")
  *         return cont1_array(self.internal_state, rk_standard_gamma, size,
  *                            oshape, self.lock)             # <<<<<<<<<<<<<<
@@ -21758,21 +21821,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_44standard_gamma(struct __pyx_ob
   __pyx_t_5 = __pyx_v_self->lock;
   __Pyx_INCREF(__pyx_t_5);
 
-  /* "mtrand.pyx":1897
+  /* "mtrand.pyx":1900
  *         if np.any(np.signbit(oshape)):
  *             raise ValueError("shape < 0")
  *         return cont1_array(self.internal_state, rk_standard_gamma, size,             # <<<<<<<<<<<<<<
  *                            oshape, self.lock)
  * 
  */
-  __pyx_t_2 = __pyx_f_6mtrand_cont1_array(__pyx_v_self->internal_state, rk_standard_gamma, __pyx_v_size, __pyx_v_oshape, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1897, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_6mtrand_cont1_array(__pyx_v_self->internal_state, rk_standard_gamma, __pyx_v_size, __pyx_v_oshape, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1900, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   __pyx_r = __pyx_t_2;
   __pyx_t_2 = 0;
   goto __pyx_L0;
 
-  /* "mtrand.pyx":1814
+  /* "mtrand.pyx":1817
  *                            self.lock)
  * 
  *     def standard_gamma(self, shape, size=None):             # <<<<<<<<<<<<<<
@@ -21796,7 +21859,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_44standard_gamma(struct __pyx_ob
   return __pyx_r;
 }
 
-/* "mtrand.pyx":1900
+/* "mtrand.pyx":1903
  *                            oshape, self.lock)
  * 
  *     def gamma(self, shape, scale=1.0, size=None):             # <<<<<<<<<<<<<<
@@ -21851,7 +21914,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_47gamma(PyObject *__pyx_v_self,
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gamma") < 0)) __PYX_ERR(0, 1900, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gamma") < 0)) __PYX_ERR(0, 1903, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -21870,7 +21933,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_47gamma(PyObject *__pyx_v_self,
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("gamma", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1900, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("gamma", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1903, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("mtrand.RandomState.gamma", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -21899,14 +21962,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_46gamma(struct __pyx_obj_6mtrand
   PyObject *__pyx_t_7 = NULL;
   __Pyx_RefNannySetupContext("gamma", 0);
 
-  /* "mtrand.pyx":1976
+  /* "mtrand.pyx":1979
  *         cdef double fshape, fscale
  * 
  *         oshape = <ndarray>PyArray_FROM_OTF(shape, NPY_DOUBLE, NPY_ARRAY_ALIGNED)             # <<<<<<<<<<<<<<
  *         oscale = <ndarray>PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  */
-  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_shape, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1976, __pyx_L1_error)
+  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_shape, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1979, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_2 = __pyx_t_1;
   __Pyx_INCREF(__pyx_t_2);
@@ -21914,14 +21977,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_46gamma(struct __pyx_obj_6mtrand
   __pyx_v_oshape = ((PyArrayObject *)__pyx_t_2);
   __pyx_t_2 = 0;
 
-  /* "mtrand.pyx":1977
+  /* "mtrand.pyx":1980
  * 
  *         oshape = <ndarray>PyArray_FROM_OTF(shape, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  *         oscale = <ndarray>PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)             # <<<<<<<<<<<<<<
  * 
  *         if oshape.shape == oscale.shape == ():
  */
-  __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1977, __pyx_L1_error)
+  __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1980, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_1 = __pyx_t_2;
   __Pyx_INCREF(__pyx_t_1);
@@ -21929,61 +21992,61 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_46gamma(struct __pyx_obj_6mtrand
   __pyx_v_oscale = ((PyArrayObject *)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "mtrand.pyx":1979
+  /* "mtrand.pyx":1982
  *         oscale = <ndarray>PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if oshape.shape == oscale.shape == ():             # <<<<<<<<<<<<<<
  *             fshape = PyFloat_AsDouble(shape)
  *             fscale = PyFloat_AsDouble(scale)
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_oshape), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1979, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_oshape), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1982, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_oscale), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1979, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_oscale), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1982, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1979, __pyx_L1_error)
+  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1982, __pyx_L1_error)
   if (__Pyx_PyObject_IsTrue(__pyx_t_3)) {
     __Pyx_DECREF(__pyx_t_3);
-    __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1979, __pyx_L1_error)
+    __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1982, __pyx_L1_error)
   }
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1979, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1982, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   if (__pyx_t_4) {
 
-    /* "mtrand.pyx":1980
+    /* "mtrand.pyx":1983
  * 
  *         if oshape.shape == oscale.shape == ():
  *             fshape = PyFloat_AsDouble(shape)             # <<<<<<<<<<<<<<
  *             fscale = PyFloat_AsDouble(scale)
  *             if np.signbit(fshape):
  */
-    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_shape); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 1980, __pyx_L1_error)
+    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_shape); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 1983, __pyx_L1_error)
     __pyx_v_fshape = __pyx_t_5;
 
-    /* "mtrand.pyx":1981
+    /* "mtrand.pyx":1984
  *         if oshape.shape == oscale.shape == ():
  *             fshape = PyFloat_AsDouble(shape)
  *             fscale = PyFloat_AsDouble(scale)             # <<<<<<<<<<<<<<
  *             if np.signbit(fshape):
  *                 raise ValueError("shape < 0")
  */
-    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_scale); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 1981, __pyx_L1_error)
+    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_scale); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 1984, __pyx_L1_error)
     __pyx_v_fscale = __pyx_t_5;
 
-    /* "mtrand.pyx":1982
+    /* "mtrand.pyx":1985
  *             fshape = PyFloat_AsDouble(shape)
  *             fscale = PyFloat_AsDouble(scale)
  *             if np.signbit(fshape):             # <<<<<<<<<<<<<<
  *                 raise ValueError("shape < 0")
  *             if np.signbit(fscale):
  */
-    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1982, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1985, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_signbit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1982, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_signbit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1985, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_fshape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1982, __pyx_L1_error)
+    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_fshape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1985, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_t_6 = NULL;
     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
@@ -21998,27 +22061,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_46gamma(struct __pyx_obj_6mtrand
     __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2);
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1982, __pyx_L1_error)
+    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1985, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1982, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1985, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     if (unlikely(__pyx_t_4)) {
 
-      /* "mtrand.pyx":1983
+      /* "mtrand.pyx":1986
  *             fscale = PyFloat_AsDouble(scale)
  *             if np.signbit(fshape):
  *                 raise ValueError("shape < 0")             # <<<<<<<<<<<<<<
  *             if np.signbit(fscale):
  *                 raise ValueError("scale < 0")
  */
-      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1983, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1986, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __PYX_ERR(0, 1983, __pyx_L1_error)
+      __PYX_ERR(0, 1986, __pyx_L1_error)
 
-      /* "mtrand.pyx":1982
+      /* "mtrand.pyx":1985
  *             fshape = PyFloat_AsDouble(shape)
  *             fscale = PyFloat_AsDouble(scale)
  *             if np.signbit(fshape):             # <<<<<<<<<<<<<<
@@ -22027,19 +22090,19 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_46gamma(struct __pyx_obj_6mtrand
  */
     }
 
-    /* "mtrand.pyx":1984
+    /* "mtrand.pyx":1987
  *             if np.signbit(fshape):
  *                 raise ValueError("shape < 0")
  *             if np.signbit(fscale):             # <<<<<<<<<<<<<<
  *                 raise ValueError("scale < 0")
  *             return cont2_array_sc(self.internal_state, rk_gamma, size, fshape,
  */
-    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1984, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1987, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_signbit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1984, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_signbit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1987, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_1 = PyFloat_FromDouble(__pyx_v_fscale); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1984, __pyx_L1_error)
+    __pyx_t_1 = PyFloat_FromDouble(__pyx_v_fscale); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1987, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __pyx_t_6 = NULL;
     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
@@ -22054,27 +22117,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_46gamma(struct __pyx_obj_6mtrand
     __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1);
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1984, __pyx_L1_error)
+    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1987, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1984, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1987, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     if (unlikely(__pyx_t_4)) {
 
-      /* "mtrand.pyx":1985
+      /* "mtrand.pyx":1988
  *                 raise ValueError("shape < 0")
  *             if np.signbit(fscale):
  *                 raise ValueError("scale < 0")             # <<<<<<<<<<<<<<
  *             return cont2_array_sc(self.internal_state, rk_gamma, size, fshape,
  *                                   fscale, self.lock)
  */
-      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1985, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1988, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __PYX_ERR(0, 1985, __pyx_L1_error)
+      __PYX_ERR(0, 1988, __pyx_L1_error)
 
-      /* "mtrand.pyx":1984
+      /* "mtrand.pyx":1987
  *             if np.signbit(fshape):
  *                 raise ValueError("shape < 0")
  *             if np.signbit(fscale):             # <<<<<<<<<<<<<<
@@ -22083,7 +22146,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_46gamma(struct __pyx_obj_6mtrand
  */
     }
 
-    /* "mtrand.pyx":1986
+    /* "mtrand.pyx":1989
  *             if np.signbit(fscale):
  *                 raise ValueError("scale < 0")
  *             return cont2_array_sc(self.internal_state, rk_gamma, size, fshape,             # <<<<<<<<<<<<<<
@@ -22092,7 +22155,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_46gamma(struct __pyx_obj_6mtrand
  */
     __Pyx_XDECREF(__pyx_r);
 
-    /* "mtrand.pyx":1987
+    /* "mtrand.pyx":1990
  *                 raise ValueError("scale < 0")
  *             return cont2_array_sc(self.internal_state, rk_gamma, size, fshape,
  *                                   fscale, self.lock)             # <<<<<<<<<<<<<<
@@ -22102,21 +22165,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_46gamma(struct __pyx_obj_6mtrand
     __pyx_t_3 = __pyx_v_self->lock;
     __Pyx_INCREF(__pyx_t_3);
 
-    /* "mtrand.pyx":1986
+    /* "mtrand.pyx":1989
  *             if np.signbit(fscale):
  *                 raise ValueError("scale < 0")
  *             return cont2_array_sc(self.internal_state, rk_gamma, size, fshape,             # <<<<<<<<<<<<<<
  *                                   fscale, self.lock)
  * 
  */
-    __pyx_t_2 = __pyx_f_6mtrand_cont2_array_sc(__pyx_v_self->internal_state, rk_gamma, __pyx_v_size, __pyx_v_fshape, __pyx_v_fscale, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1986, __pyx_L1_error)
+    __pyx_t_2 = __pyx_f_6mtrand_cont2_array_sc(__pyx_v_self->internal_state, rk_gamma, __pyx_v_size, __pyx_v_fshape, __pyx_v_fscale, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1989, __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;
 
-    /* "mtrand.pyx":1979
+    /* "mtrand.pyx":1982
  *         oscale = <ndarray>PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if oshape.shape == oscale.shape == ():             # <<<<<<<<<<<<<<
@@ -22125,21 +22188,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_46gamma(struct __pyx_obj_6mtrand
  */
   }
 
-  /* "mtrand.pyx":1989
+  /* "mtrand.pyx":1992
  *                                   fscale, self.lock)
  * 
  *         if np.any(np.signbit(oshape)):             # <<<<<<<<<<<<<<
  *             raise ValueError("shape < 0")
  *         if np.any(np.signbit(oscale)):
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1989, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1992, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_any); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1989, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_any); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1992, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1989, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1992, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_signbit); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1989, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_signbit); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1992, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   __pyx_t_6 = NULL;
@@ -22154,7 +22217,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_46gamma(struct __pyx_obj_6mtrand
   }
   __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_6, ((PyObject *)__pyx_v_oshape)) : __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_v_oshape));
   __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1989, __pyx_L1_error)
+  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1992, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   __pyx_t_7 = NULL;
@@ -22170,27 +22233,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_46gamma(struct __pyx_obj_6mtrand
   __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_7, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3);
   __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1989, __pyx_L1_error)
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1992, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1989, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1992, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (unlikely(__pyx_t_4)) {
 
-    /* "mtrand.pyx":1990
+    /* "mtrand.pyx":1993
  * 
  *         if np.any(np.signbit(oshape)):
  *             raise ValueError("shape < 0")             # <<<<<<<<<<<<<<
  *         if np.any(np.signbit(oscale)):
  *             raise ValueError("scale < 0")
  */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1990, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1993, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __PYX_ERR(0, 1990, __pyx_L1_error)
+    __PYX_ERR(0, 1993, __pyx_L1_error)
 
-    /* "mtrand.pyx":1989
+    /* "mtrand.pyx":1992
  *                                   fscale, self.lock)
  * 
  *         if np.any(np.signbit(oshape)):             # <<<<<<<<<<<<<<
@@ -22199,21 +22262,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_46gamma(struct __pyx_obj_6mtrand
  */
   }
 
-  /* "mtrand.pyx":1991
+  /* "mtrand.pyx":1994
  *         if np.any(np.signbit(oshape)):
  *             raise ValueError("shape < 0")
  *         if np.any(np.signbit(oscale)):             # <<<<<<<<<<<<<<
  *             raise ValueError("scale < 0")
  *         return cont2_array(self.internal_state, rk_gamma, size, oshape, oscale,
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1991, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1994, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_any); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1991, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_any); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1994, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1991, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1994, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_signbit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1991, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_signbit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1994, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   __pyx_t_7 = NULL;
@@ -22228,7 +22291,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_46gamma(struct __pyx_obj_6mtrand
   }
   __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, ((PyObject *)__pyx_v_oscale)) : __Pyx_PyObject_CallOneArg(__pyx_t_6, ((PyObject *)__pyx_v_oscale));
   __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
-  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1991, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1994, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   __pyx_t_6 = NULL;
@@ -22244,27 +22307,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_46gamma(struct __pyx_obj_6mtrand
   __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1);
   __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1991, __pyx_L1_error)
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1994, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1991, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1994, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (unlikely(__pyx_t_4)) {
 
-    /* "mtrand.pyx":1992
+    /* "mtrand.pyx":1995
  *             raise ValueError("shape < 0")
  *         if np.any(np.signbit(oscale)):
  *             raise ValueError("scale < 0")             # <<<<<<<<<<<<<<
  *         return cont2_array(self.internal_state, rk_gamma, size, oshape, oscale,
  *                            self.lock)
  */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1992, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1995, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __PYX_ERR(0, 1992, __pyx_L1_error)
+    __PYX_ERR(0, 1995, __pyx_L1_error)
 
-    /* "mtrand.pyx":1991
+    /* "mtrand.pyx":1994
  *         if np.any(np.signbit(oshape)):
  *             raise ValueError("shape < 0")
  *         if np.any(np.signbit(oscale)):             # <<<<<<<<<<<<<<
@@ -22273,7 +22336,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_46gamma(struct __pyx_obj_6mtrand
  */
   }
 
-  /* "mtrand.pyx":1993
+  /* "mtrand.pyx":1996
  *         if np.any(np.signbit(oscale)):
  *             raise ValueError("scale < 0")
  *         return cont2_array(self.internal_state, rk_gamma, size, oshape, oscale,             # <<<<<<<<<<<<<<
@@ -22282,7 +22345,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_46gamma(struct __pyx_obj_6mtrand
  */
   __Pyx_XDECREF(__pyx_r);
 
-  /* "mtrand.pyx":1994
+  /* "mtrand.pyx":1997
  *             raise ValueError("scale < 0")
  *         return cont2_array(self.internal_state, rk_gamma, size, oshape, oscale,
  *                            self.lock)             # <<<<<<<<<<<<<<
@@ -22292,21 +22355,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_46gamma(struct __pyx_obj_6mtrand
   __pyx_t_2 = __pyx_v_self->lock;
   __Pyx_INCREF(__pyx_t_2);
 
-  /* "mtrand.pyx":1993
+  /* "mtrand.pyx":1996
  *         if np.any(np.signbit(oscale)):
  *             raise ValueError("scale < 0")
  *         return cont2_array(self.internal_state, rk_gamma, size, oshape, oscale,             # <<<<<<<<<<<<<<
  *                            self.lock)
  * 
  */
-  __pyx_t_3 = __pyx_f_6mtrand_cont2_array(__pyx_v_self->internal_state, rk_gamma, __pyx_v_size, __pyx_v_oshape, __pyx_v_oscale, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1993, __pyx_L1_error)
+  __pyx_t_3 = __pyx_f_6mtrand_cont2_array(__pyx_v_self->internal_state, rk_gamma, __pyx_v_size, __pyx_v_oshape, __pyx_v_oscale, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1996, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_r = __pyx_t_3;
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  /* "mtrand.pyx":1900
+  /* "mtrand.pyx":1903
  *                            oshape, self.lock)
  * 
  *     def gamma(self, shape, scale=1.0, size=None):             # <<<<<<<<<<<<<<
@@ -22331,7 +22394,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_46gamma(struct __pyx_obj_6mtrand
   return __pyx_r;
 }
 
-/* "mtrand.pyx":1996
+/* "mtrand.pyx":1999
  *                            self.lock)
  * 
  *     def f(self, dfnum, dfden, size=None):             # <<<<<<<<<<<<<<
@@ -22375,7 +22438,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_49f(PyObject *__pyx_v_self, PyOb
         case  1:
         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dfden)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("f", 0, 2, 3, 1); __PYX_ERR(0, 1996, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("f", 0, 2, 3, 1); __PYX_ERR(0, 1999, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  2:
@@ -22385,7 +22448,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_49f(PyObject *__pyx_v_self, PyOb
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "f") < 0)) __PYX_ERR(0, 1996, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "f") < 0)) __PYX_ERR(0, 1999, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -22403,7 +22466,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_49f(PyObject *__pyx_v_self, PyOb
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("f", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1996, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("f", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1999, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("mtrand.RandomState.f", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -22434,14 +22497,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_48f(struct __pyx_obj_6mtrand_Ran
   PyObject *__pyx_t_9 = NULL;
   __Pyx_RefNannySetupContext("f", 0);
 
-  /* "mtrand.pyx":2082
+  /* "mtrand.pyx":2085
  *         cdef double fdfnum, fdfden
  * 
  *         odfnum = <ndarray>PyArray_FROM_OTF(dfnum, NPY_DOUBLE, NPY_ARRAY_ALIGNED)             # <<<<<<<<<<<<<<
  *         odfden = <ndarray>PyArray_FROM_OTF(dfden, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  */
-  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_dfnum, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2082, __pyx_L1_error)
+  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_dfnum, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2085, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_2 = __pyx_t_1;
   __Pyx_INCREF(__pyx_t_2);
@@ -22449,14 +22512,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_48f(struct __pyx_obj_6mtrand_Ran
   __pyx_v_odfnum = ((PyArrayObject *)__pyx_t_2);
   __pyx_t_2 = 0;
 
-  /* "mtrand.pyx":2083
+  /* "mtrand.pyx":2086
  * 
  *         odfnum = <ndarray>PyArray_FROM_OTF(dfnum, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  *         odfden = <ndarray>PyArray_FROM_OTF(dfden, NPY_DOUBLE, NPY_ARRAY_ALIGNED)             # <<<<<<<<<<<<<<
  * 
  *         if odfnum.shape == odfden.shape == ():
  */
-  __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_dfden, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2083, __pyx_L1_error)
+  __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_dfden, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2086, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_1 = __pyx_t_2;
   __Pyx_INCREF(__pyx_t_1);
@@ -22464,49 +22527,49 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_48f(struct __pyx_obj_6mtrand_Ran
   __pyx_v_odfden = ((PyArrayObject *)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "mtrand.pyx":2085
+  /* "mtrand.pyx":2088
  *         odfden = <ndarray>PyArray_FROM_OTF(dfden, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if odfnum.shape == odfden.shape == ():             # <<<<<<<<<<<<<<
  *             fdfnum = PyFloat_AsDouble(dfnum)
  *             fdfden = PyFloat_AsDouble(dfden)
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_odfnum), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2085, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_odfnum), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2088, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_odfden), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2085, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_odfden), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2088, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2085, __pyx_L1_error)
+  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2088, __pyx_L1_error)
   if (__Pyx_PyObject_IsTrue(__pyx_t_3)) {
     __Pyx_DECREF(__pyx_t_3);
-    __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2085, __pyx_L1_error)
+    __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2088, __pyx_L1_error)
   }
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2085, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2088, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   if (__pyx_t_4) {
 
-    /* "mtrand.pyx":2086
+    /* "mtrand.pyx":2089
  * 
  *         if odfnum.shape == odfden.shape == ():
  *             fdfnum = PyFloat_AsDouble(dfnum)             # <<<<<<<<<<<<<<
  *             fdfden = PyFloat_AsDouble(dfden)
  * 
  */
-    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_dfnum); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 2086, __pyx_L1_error)
+    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_dfnum); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 2089, __pyx_L1_error)
     __pyx_v_fdfnum = __pyx_t_5;
 
-    /* "mtrand.pyx":2087
+    /* "mtrand.pyx":2090
  *         if odfnum.shape == odfden.shape == ():
  *             fdfnum = PyFloat_AsDouble(dfnum)
  *             fdfden = PyFloat_AsDouble(dfden)             # <<<<<<<<<<<<<<
  * 
  *             if fdfnum <= 0:
  */
-    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_dfden); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 2087, __pyx_L1_error)
+    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_dfden); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 2090, __pyx_L1_error)
     __pyx_v_fdfden = __pyx_t_5;
 
-    /* "mtrand.pyx":2089
+    /* "mtrand.pyx":2092
  *             fdfden = PyFloat_AsDouble(dfden)
  * 
  *             if fdfnum <= 0:             # <<<<<<<<<<<<<<
@@ -22516,20 +22579,20 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_48f(struct __pyx_obj_6mtrand_Ran
     __pyx_t_4 = ((__pyx_v_fdfnum <= 0.0) != 0);
     if (unlikely(__pyx_t_4)) {
 
-      /* "mtrand.pyx":2090
+      /* "mtrand.pyx":2093
  * 
  *             if fdfnum <= 0:
  *                 raise ValueError("dfnum <= 0")             # <<<<<<<<<<<<<<
  *             if fdfden <= 0:
  *                 raise ValueError("dfden <= 0")
  */
-      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2090, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2093, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __PYX_ERR(0, 2090, __pyx_L1_error)
+      __PYX_ERR(0, 2093, __pyx_L1_error)
 
-      /* "mtrand.pyx":2089
+      /* "mtrand.pyx":2092
  *             fdfden = PyFloat_AsDouble(dfden)
  * 
  *             if fdfnum <= 0:             # <<<<<<<<<<<<<<
@@ -22538,7 +22601,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_48f(struct __pyx_obj_6mtrand_Ran
  */
     }
 
-    /* "mtrand.pyx":2091
+    /* "mtrand.pyx":2094
  *             if fdfnum <= 0:
  *                 raise ValueError("dfnum <= 0")
  *             if fdfden <= 0:             # <<<<<<<<<<<<<<
@@ -22548,20 +22611,20 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_48f(struct __pyx_obj_6mtrand_Ran
     __pyx_t_4 = ((__pyx_v_fdfden <= 0.0) != 0);
     if (unlikely(__pyx_t_4)) {
 
-      /* "mtrand.pyx":2092
+      /* "mtrand.pyx":2095
  *                 raise ValueError("dfnum <= 0")
  *             if fdfden <= 0:
  *                 raise ValueError("dfden <= 0")             # <<<<<<<<<<<<<<
  *             return cont2_array_sc(self.internal_state, rk_f, size, fdfnum,
  *                                   fdfden, self.lock)
  */
-      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2092, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2095, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __PYX_ERR(0, 2092, __pyx_L1_error)
+      __PYX_ERR(0, 2095, __pyx_L1_error)
 
-      /* "mtrand.pyx":2091
+      /* "mtrand.pyx":2094
  *             if fdfnum <= 0:
  *                 raise ValueError("dfnum <= 0")
  *             if fdfden <= 0:             # <<<<<<<<<<<<<<
@@ -22570,7 +22633,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_48f(struct __pyx_obj_6mtrand_Ran
  */
     }
 
-    /* "mtrand.pyx":2093
+    /* "mtrand.pyx":2096
  *             if fdfden <= 0:
  *                 raise ValueError("dfden <= 0")
  *             return cont2_array_sc(self.internal_state, rk_f, size, fdfnum,             # <<<<<<<<<<<<<<
@@ -22579,7 +22642,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_48f(struct __pyx_obj_6mtrand_Ran
  */
     __Pyx_XDECREF(__pyx_r);
 
-    /* "mtrand.pyx":2094
+    /* "mtrand.pyx":2097
  *                 raise ValueError("dfden <= 0")
  *             return cont2_array_sc(self.internal_state, rk_f, size, fdfnum,
  *                                   fdfden, self.lock)             # <<<<<<<<<<<<<<
@@ -22589,21 +22652,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_48f(struct __pyx_obj_6mtrand_Ran
     __pyx_t_3 = __pyx_v_self->lock;
     __Pyx_INCREF(__pyx_t_3);
 
-    /* "mtrand.pyx":2093
+    /* "mtrand.pyx":2096
  *             if fdfden <= 0:
  *                 raise ValueError("dfden <= 0")
  *             return cont2_array_sc(self.internal_state, rk_f, size, fdfnum,             # <<<<<<<<<<<<<<
  *                                   fdfden, self.lock)
  * 
  */
-    __pyx_t_2 = __pyx_f_6mtrand_cont2_array_sc(__pyx_v_self->internal_state, rk_f, __pyx_v_size, __pyx_v_fdfnum, __pyx_v_fdfden, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2093, __pyx_L1_error)
+    __pyx_t_2 = __pyx_f_6mtrand_cont2_array_sc(__pyx_v_self->internal_state, rk_f, __pyx_v_size, __pyx_v_fdfnum, __pyx_v_fdfden, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2096, __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;
 
-    /* "mtrand.pyx":2085
+    /* "mtrand.pyx":2088
  *         odfden = <ndarray>PyArray_FROM_OTF(dfden, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if odfnum.shape == odfden.shape == ():             # <<<<<<<<<<<<<<
@@ -22612,21 +22675,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_48f(struct __pyx_obj_6mtrand_Ran
  */
   }
 
-  /* "mtrand.pyx":2096
+  /* "mtrand.pyx":2099
  *                                   fdfden, self.lock)
  * 
  *         if np.any(np.less_equal(odfnum, 0.0)):             # <<<<<<<<<<<<<<
  *             raise ValueError("dfnum <= 0")
  *         if np.any(np.less_equal(odfden, 0.0)):
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2096, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2099, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_any); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2096, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_any); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2099, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2096, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2099, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_less_equal); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2096, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_less_equal); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2099, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   __pyx_t_6 = NULL;
@@ -22644,7 +22707,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_48f(struct __pyx_obj_6mtrand_Ran
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_7)) {
     PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_v_odfnum), __pyx_float_0_0};
-    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2096, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2099, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_GOTREF(__pyx_t_3);
   } else
@@ -22652,13 +22715,13 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_48f(struct __pyx_obj_6mtrand_Ran
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
     PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_v_odfnum), __pyx_float_0_0};
-    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2096, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2099, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_GOTREF(__pyx_t_3);
   } else
   #endif
   {
-    __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2096, __pyx_L1_error)
+    __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2099, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_9);
     if (__pyx_t_6) {
       __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL;
@@ -22669,7 +22732,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_48f(struct __pyx_obj_6mtrand_Ran
     __Pyx_INCREF(__pyx_float_0_0);
     __Pyx_GIVEREF(__pyx_float_0_0);
     PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_float_0_0);
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2096, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2099, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
   }
@@ -22687,27 +22750,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_48f(struct __pyx_obj_6mtrand_Ran
   __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_7, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3);
   __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2096, __pyx_L1_error)
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2099, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2096, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2099, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (unlikely(__pyx_t_4)) {
 
-    /* "mtrand.pyx":2097
+    /* "mtrand.pyx":2100
  * 
  *         if np.any(np.less_equal(odfnum, 0.0)):
  *             raise ValueError("dfnum <= 0")             # <<<<<<<<<<<<<<
  *         if np.any(np.less_equal(odfden, 0.0)):
  *             raise ValueError("dfden <= 0")
  */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2097, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2100, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __PYX_ERR(0, 2097, __pyx_L1_error)
+    __PYX_ERR(0, 2100, __pyx_L1_error)
 
-    /* "mtrand.pyx":2096
+    /* "mtrand.pyx":2099
  *                                   fdfden, self.lock)
  * 
  *         if np.any(np.less_equal(odfnum, 0.0)):             # <<<<<<<<<<<<<<
@@ -22716,21 +22779,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_48f(struct __pyx_obj_6mtrand_Ran
  */
   }
 
-  /* "mtrand.pyx":2098
+  /* "mtrand.pyx":2101
  *         if np.any(np.less_equal(odfnum, 0.0)):
  *             raise ValueError("dfnum <= 0")
  *         if np.any(np.less_equal(odfden, 0.0)):             # <<<<<<<<<<<<<<
  *             raise ValueError("dfden <= 0")
  *         return cont2_array(self.internal_state, rk_f, size, odfnum, odfden,
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2098, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2101, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_any); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2098, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_any); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2101, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2098, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2101, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_less_equal); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2098, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_less_equal); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2101, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   __pyx_t_7 = NULL;
@@ -22748,7 +22811,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_48f(struct __pyx_obj_6mtrand_Ran
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_9)) {
     PyObject *__pyx_temp[3] = {__pyx_t_7, ((PyObject *)__pyx_v_odfden), __pyx_float_0_0};
-    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2098, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2101, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
@@ -22756,13 +22819,13 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_48f(struct __pyx_obj_6mtrand_Ran
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
     PyObject *__pyx_temp[3] = {__pyx_t_7, ((PyObject *)__pyx_v_odfden), __pyx_float_0_0};
-    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2098, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2101, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
   #endif
   {
-    __pyx_t_6 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2098, __pyx_L1_error)
+    __pyx_t_6 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2101, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     if (__pyx_t_7) {
       __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = NULL;
@@ -22773,7 +22836,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_48f(struct __pyx_obj_6mtrand_Ran
     __Pyx_INCREF(__pyx_float_0_0);
     __Pyx_GIVEREF(__pyx_float_0_0);
     PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_float_0_0);
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2098, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2101, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   }
@@ -22791,27 +22854,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_48f(struct __pyx_obj_6mtrand_Ran
   __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_9, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1);
   __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2098, __pyx_L1_error)
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2101, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2098, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2101, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (unlikely(__pyx_t_4)) {
 
-    /* "mtrand.pyx":2099
+    /* "mtrand.pyx":2102
  *             raise ValueError("dfnum <= 0")
  *         if np.any(np.less_equal(odfden, 0.0)):
  *             raise ValueError("dfden <= 0")             # <<<<<<<<<<<<<<
  *         return cont2_array(self.internal_state, rk_f, size, odfnum, odfden,
  *                            self.lock)
  */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2099, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2102, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __PYX_ERR(0, 2099, __pyx_L1_error)
+    __PYX_ERR(0, 2102, __pyx_L1_error)
 
-    /* "mtrand.pyx":2098
+    /* "mtrand.pyx":2101
  *         if np.any(np.less_equal(odfnum, 0.0)):
  *             raise ValueError("dfnum <= 0")
  *         if np.any(np.less_equal(odfden, 0.0)):             # <<<<<<<<<<<<<<
@@ -22820,7 +22883,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_48f(struct __pyx_obj_6mtrand_Ran
  */
   }
 
-  /* "mtrand.pyx":2100
+  /* "mtrand.pyx":2103
  *         if np.any(np.less_equal(odfden, 0.0)):
  *             raise ValueError("dfden <= 0")
  *         return cont2_array(self.internal_state, rk_f, size, odfnum, odfden,             # <<<<<<<<<<<<<<
@@ -22829,7 +22892,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_48f(struct __pyx_obj_6mtrand_Ran
  */
   __Pyx_XDECREF(__pyx_r);
 
-  /* "mtrand.pyx":2101
+  /* "mtrand.pyx":2104
  *             raise ValueError("dfden <= 0")
  *         return cont2_array(self.internal_state, rk_f, size, odfnum, odfden,
  *                            self.lock)             # <<<<<<<<<<<<<<
@@ -22839,21 +22902,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_48f(struct __pyx_obj_6mtrand_Ran
   __pyx_t_2 = __pyx_v_self->lock;
   __Pyx_INCREF(__pyx_t_2);
 
-  /* "mtrand.pyx":2100
+  /* "mtrand.pyx":2103
  *         if np.any(np.less_equal(odfden, 0.0)):
  *             raise ValueError("dfden <= 0")
  *         return cont2_array(self.internal_state, rk_f, size, odfnum, odfden,             # <<<<<<<<<<<<<<
  *                            self.lock)
  * 
  */
-  __pyx_t_3 = __pyx_f_6mtrand_cont2_array(__pyx_v_self->internal_state, rk_f, __pyx_v_size, __pyx_v_odfnum, __pyx_v_odfden, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2100, __pyx_L1_error)
+  __pyx_t_3 = __pyx_f_6mtrand_cont2_array(__pyx_v_self->internal_state, rk_f, __pyx_v_size, __pyx_v_odfnum, __pyx_v_odfden, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2103, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_r = __pyx_t_3;
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  /* "mtrand.pyx":1996
+  /* "mtrand.pyx":1999
  *                            self.lock)
  * 
  *     def f(self, dfnum, dfden, size=None):             # <<<<<<<<<<<<<<
@@ -22879,7 +22942,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_48f(struct __pyx_obj_6mtrand_Ran
   return __pyx_r;
 }
 
-/* "mtrand.pyx":2103
+/* "mtrand.pyx":2106
  *                            self.lock)
  * 
  *     def noncentral_f(self, dfnum, dfden, nonc, size=None):             # <<<<<<<<<<<<<<
@@ -22889,7 +22952,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_48f(struct __pyx_obj_6mtrand_Ran
 
 /* Python wrapper */
 static PyObject *__pyx_pw_6mtrand_11RandomState_51noncentral_f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_50noncentral_f[] = "\n        noncentral_f(dfnum, dfden, nonc, size=None)\n\n        Draw samples from the noncentral F distribution.\n\n        Samples are drawn from an F distribution with specified parameters,\n        `dfnum` (degrees of freedom in numerator) and `dfden` (degrees of\n        freedom in denominator), where both parameters > 1.\n        `nonc` is the non-centrality parameter.\n\n        Parameters\n        ----------\n        dfnum : float or array_like of floats\n            Numerator degrees of freedom, should be > 0.\n\n            .. versionchanged:: 1.14.0\n               Earlier NumPy versions required dfnum > 1.\n        dfden : float or array_like of floats\n            Denominator degrees of freedom, should be > 0.\n        nonc : float or array_like of floats\n            Non-centrality parameter, the sum of the squares of the numerator\n            means, should be >= 0.\n        size : int or tuple of ints, optional\n            Output shape.  If the given shape is, e.g., ``(m, n, k)``, then\n            ``m * n * k`` samples are drawn.  If size is ``None`` (default),\n            a single value is returned if ``dfnum``, ``dfden``, and ``nonc``\n            are all scalars.  Otherwise, ``np.broadcast(dfnum, dfden, nonc).size``\n            samples are drawn.\n\n        Returns\n        -------\n        out : ndarray or scalar\n            Drawn samples from the parameterized noncentral Fisher distribution.\n\n        Notes\n        -----\n        When calculating the power of an experiment (power = probability of\n        rejecting the null hypothesis when a specific alternative is true) the\n        non-central F statistic becomes important.  When the null hypothesis is\n        true, the F statistic follows a central F distribution. When the null\n        hypothesis is not true, then it follows a non-central F statistic.\n\n        References\n        ----------\n        .. [1] Weisstein, Eric W. \"Noncentral F-Distribution.\"\n               From MathW""orld--A Wolfram Web Resource.\n               http://mathworld.wolfram.com/NoncentralF-Distribution.html\n        .. [2] Wikipedia, \"Noncentral F-distribution\",\n               https://en.wikipedia.org/wiki/Noncentral_F-distribution\n\n        Examples\n        --------\n        In a study, testing for a specific alternative to the null hypothesis\n        requires use of the Noncentral F distribution. We need to calculate the\n        area in the tail of the distribution that exceeds the value of the F\n        distribution for the null hypothesis.  We'll plot the two probability\n        distributions for comparison.\n\n        >>> dfnum = 3 # between group deg of freedom\n        >>> dfden = 20 # within groups degrees of freedom\n        >>> nonc = 3.0\n        >>> nc_vals = np.random.noncentral_f(dfnum, dfden, nonc, 1000000)\n        >>> NF = np.histogram(nc_vals, bins=50, density=True)\n        >>> c_vals = np.random.f(dfnum, dfden, 1000000)\n        >>> F = np.histogram(c_vals, bins=50, density=True)\n        >>> plt.plot(F[1][1:], F[0])\n        >>> plt.plot(NF[1][1:], NF[0])\n        >>> plt.show()\n\n        ";
+static char __pyx_doc_6mtrand_11RandomState_50noncentral_f[] = "\n        noncentral_f(dfnum, dfden, nonc, size=None)\n\n        Draw samples from the noncentral F distribution.\n\n        Samples are drawn from an F distribution with specified parameters,\n        `dfnum` (degrees of freedom in numerator) and `dfden` (degrees of\n        freedom in denominator), where both parameters > 1.\n        `nonc` is the non-centrality parameter.\n\n        Parameters\n        ----------\n        dfnum : float or array_like of floats\n            Numerator degrees of freedom, should be > 0.\n\n            .. versionchanged:: 1.14.0\n               Earlier NumPy versions required dfnum > 1.\n        dfden : float or array_like of floats\n            Denominator degrees of freedom, should be > 0.\n        nonc : float or array_like of floats\n            Non-centrality parameter, the sum of the squares of the numerator\n            means, should be >= 0.\n        size : int or tuple of ints, optional\n            Output shape.  If the given shape is, e.g., ``(m, n, k)``, then\n            ``m * n * k`` samples are drawn.  If size is ``None`` (default),\n            a single value is returned if ``dfnum``, ``dfden``, and ``nonc``\n            are all scalars.  Otherwise, ``np.broadcast(dfnum, dfden, nonc).size``\n            samples are drawn.\n\n        Returns\n        -------\n        out : ndarray or scalar\n            Drawn samples from the parameterized noncentral Fisher distribution.\n\n        Notes\n        -----\n        When calculating the power of an experiment (power = probability of\n        rejecting the null hypothesis when a specific alternative is true) the\n        non-central F statistic becomes important.  When the null hypothesis is\n        true, the F statistic follows a central F distribution. When the null\n        hypothesis is not true, then it follows a non-central F statistic.\n\n        References\n        ----------\n        .. [1] Weisstein, Eric W. \"Noncentral F-Distribution.\"\n               From MathW""orld--A Wolfram Web Resource.\n               http://mathworld.wolfram.com/NoncentralF-Distribution.html\n        .. [2] Wikipedia, \"Noncentral F-distribution\",\n               https://en.wikipedia.org/wiki/Noncentral_F-distribution\n\n        Examples\n        --------\n        In a study, testing for a specific alternative to the null hypothesis\n        requires use of the Noncentral F distribution. We need to calculate the\n        area in the tail of the distribution that exceeds the value of the F\n        distribution for the null hypothesis.  We'll plot the two probability\n        distributions for comparison.\n\n        >>> dfnum = 3 # between group deg of freedom\n        >>> dfden = 20 # within groups degrees of freedom\n        >>> nonc = 3.0\n        >>> nc_vals = np.random.noncentral_f(dfnum, dfden, nonc, 1000000)\n        >>> NF = np.histogram(nc_vals, bins=50, density=True)\n        >>> c_vals = np.random.f(dfnum, dfden, 1000000)\n        >>> F = np.histogram(c_vals, bins=50, density=True)\n        >>> import matplotlib.pyplot as plt\n        >>> plt.plot(F[1][1:], F[0])\n        >>> plt.plot(NF[1][1:], NF[0])\n        >>> plt.show()\n\n        ";
 static PyObject *__pyx_pw_6mtrand_11RandomState_51noncentral_f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyObject *__pyx_v_dfnum = 0;
   PyObject *__pyx_v_dfden = 0;
@@ -22926,13 +22989,13 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_51noncentral_f(PyObject *__pyx_v
         case  1:
         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dfden)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("noncentral_f", 0, 3, 4, 1); __PYX_ERR(0, 2103, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("noncentral_f", 0, 3, 4, 1); __PYX_ERR(0, 2106, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  2:
         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nonc)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("noncentral_f", 0, 3, 4, 2); __PYX_ERR(0, 2103, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("noncentral_f", 0, 3, 4, 2); __PYX_ERR(0, 2106, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  3:
@@ -22942,7 +23005,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_51noncentral_f(PyObject *__pyx_v
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "noncentral_f") < 0)) __PYX_ERR(0, 2103, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "noncentral_f") < 0)) __PYX_ERR(0, 2106, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -22962,7 +23025,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_51noncentral_f(PyObject *__pyx_v
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("noncentral_f", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2103, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("noncentral_f", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2106, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("mtrand.RandomState.noncentral_f", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -22995,14 +23058,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_50noncentral_f(struct __pyx_obj_
   PyObject *__pyx_t_9 = NULL;
   __Pyx_RefNannySetupContext("noncentral_f", 0);
 
-  /* "mtrand.pyx":2177
+  /* "mtrand.pyx":2181
  *         cdef double fdfnum, fdfden, fnonc
  * 
  *         odfnum = <ndarray>PyArray_FROM_OTF(dfnum, NPY_DOUBLE, NPY_ARRAY_ALIGNED)             # <<<<<<<<<<<<<<
  *         odfden = <ndarray>PyArray_FROM_OTF(dfden, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  *         ononc = <ndarray>PyArray_FROM_OTF(nonc, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  */
-  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_dfnum, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2177, __pyx_L1_error)
+  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_dfnum, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2181, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_2 = __pyx_t_1;
   __Pyx_INCREF(__pyx_t_2);
@@ -23010,14 +23073,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_50noncentral_f(struct __pyx_obj_
   __pyx_v_odfnum = ((PyArrayObject *)__pyx_t_2);
   __pyx_t_2 = 0;
 
-  /* "mtrand.pyx":2178
+  /* "mtrand.pyx":2182
  * 
  *         odfnum = <ndarray>PyArray_FROM_OTF(dfnum, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  *         odfden = <ndarray>PyArray_FROM_OTF(dfden, NPY_DOUBLE, NPY_ARRAY_ALIGNED)             # <<<<<<<<<<<<<<
  *         ononc = <ndarray>PyArray_FROM_OTF(nonc, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  */
-  __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_dfden, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2178, __pyx_L1_error)
+  __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_dfden, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2182, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_1 = __pyx_t_2;
   __Pyx_INCREF(__pyx_t_1);
@@ -23025,14 +23088,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_50noncentral_f(struct __pyx_obj_
   __pyx_v_odfden = ((PyArrayObject *)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "mtrand.pyx":2179
+  /* "mtrand.pyx":2183
  *         odfnum = <ndarray>PyArray_FROM_OTF(dfnum, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  *         odfden = <ndarray>PyArray_FROM_OTF(dfden, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  *         ononc = <ndarray>PyArray_FROM_OTF(nonc, NPY_DOUBLE, NPY_ARRAY_ALIGNED)             # <<<<<<<<<<<<<<
  * 
  *         if odfnum.shape == odfden.shape == ononc.shape == ():
  */
-  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_nonc, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2179, __pyx_L1_error)
+  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_nonc, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2183, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_2 = __pyx_t_1;
   __Pyx_INCREF(__pyx_t_2);
@@ -23040,66 +23103,66 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_50noncentral_f(struct __pyx_obj_
   __pyx_v_ononc = ((PyArrayObject *)__pyx_t_2);
   __pyx_t_2 = 0;
 
-  /* "mtrand.pyx":2181
+  /* "mtrand.pyx":2185
  *         ononc = <ndarray>PyArray_FROM_OTF(nonc, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if odfnum.shape == odfden.shape == ononc.shape == ():             # <<<<<<<<<<<<<<
  *             fdfnum = PyFloat_AsDouble(dfnum)
  *             fdfden = PyFloat_AsDouble(dfden)
  */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_odfnum), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2181, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_odfnum), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2185, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_odfden), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2181, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_odfden), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2185, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2181, __pyx_L1_error)
+  __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2185, __pyx_L1_error)
   if (__Pyx_PyObject_IsTrue(__pyx_t_3)) {
     __Pyx_DECREF(__pyx_t_3);
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ononc), __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2181, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ononc), __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2185, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2181, __pyx_L1_error)
+    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2185, __pyx_L1_error)
     if (__Pyx_PyObject_IsTrue(__pyx_t_3)) {
       __Pyx_DECREF(__pyx_t_3);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2181, __pyx_L1_error)
+      __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2185, __pyx_L1_error)
     }
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   }
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2181, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2185, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   if (__pyx_t_5) {
 
-    /* "mtrand.pyx":2182
+    /* "mtrand.pyx":2186
  * 
  *         if odfnum.shape == odfden.shape == ononc.shape == ():
  *             fdfnum = PyFloat_AsDouble(dfnum)             # <<<<<<<<<<<<<<
  *             fdfden = PyFloat_AsDouble(dfden)
  *             fnonc = PyFloat_AsDouble(nonc)
  */
-    __pyx_t_6 = PyFloat_AsDouble(__pyx_v_dfnum); if (unlikely(__pyx_t_6 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 2182, __pyx_L1_error)
+    __pyx_t_6 = PyFloat_AsDouble(__pyx_v_dfnum); if (unlikely(__pyx_t_6 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 2186, __pyx_L1_error)
     __pyx_v_fdfnum = __pyx_t_6;
 
-    /* "mtrand.pyx":2183
+    /* "mtrand.pyx":2187
  *         if odfnum.shape == odfden.shape == ononc.shape == ():
  *             fdfnum = PyFloat_AsDouble(dfnum)
  *             fdfden = PyFloat_AsDouble(dfden)             # <<<<<<<<<<<<<<
  *             fnonc = PyFloat_AsDouble(nonc)
  * 
  */
-    __pyx_t_6 = PyFloat_AsDouble(__pyx_v_dfden); if (unlikely(__pyx_t_6 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 2183, __pyx_L1_error)
+    __pyx_t_6 = PyFloat_AsDouble(__pyx_v_dfden); if (unlikely(__pyx_t_6 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 2187, __pyx_L1_error)
     __pyx_v_fdfden = __pyx_t_6;
 
-    /* "mtrand.pyx":2184
+    /* "mtrand.pyx":2188
  *             fdfnum = PyFloat_AsDouble(dfnum)
  *             fdfden = PyFloat_AsDouble(dfden)
  *             fnonc = PyFloat_AsDouble(nonc)             # <<<<<<<<<<<<<<
  * 
  *             if fdfnum <= 0:
  */
-    __pyx_t_6 = PyFloat_AsDouble(__pyx_v_nonc); if (unlikely(__pyx_t_6 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 2184, __pyx_L1_error)
+    __pyx_t_6 = PyFloat_AsDouble(__pyx_v_nonc); if (unlikely(__pyx_t_6 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 2188, __pyx_L1_error)
     __pyx_v_fnonc = __pyx_t_6;
 
-    /* "mtrand.pyx":2186
+    /* "mtrand.pyx":2190
  *             fnonc = PyFloat_AsDouble(nonc)
  * 
  *             if fdfnum <= 0:             # <<<<<<<<<<<<<<
@@ -23109,20 +23172,20 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_50noncentral_f(struct __pyx_obj_
     __pyx_t_5 = ((__pyx_v_fdfnum <= 0.0) != 0);
     if (unlikely(__pyx_t_5)) {
 
-      /* "mtrand.pyx":2187
+      /* "mtrand.pyx":2191
  * 
  *             if fdfnum <= 0:
  *                 raise ValueError("dfnum <= 0")             # <<<<<<<<<<<<<<
  *             if fdfden <= 0:
  *                 raise ValueError("dfden <= 0")
  */
-      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2187, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2191, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __PYX_ERR(0, 2187, __pyx_L1_error)
+      __PYX_ERR(0, 2191, __pyx_L1_error)
 
-      /* "mtrand.pyx":2186
+      /* "mtrand.pyx":2190
  *             fnonc = PyFloat_AsDouble(nonc)
  * 
  *             if fdfnum <= 0:             # <<<<<<<<<<<<<<
@@ -23131,7 +23194,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_50noncentral_f(struct __pyx_obj_
  */
     }
 
-    /* "mtrand.pyx":2188
+    /* "mtrand.pyx":2192
  *             if fdfnum <= 0:
  *                 raise ValueError("dfnum <= 0")
  *             if fdfden <= 0:             # <<<<<<<<<<<<<<
@@ -23141,20 +23204,20 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_50noncentral_f(struct __pyx_obj_
     __pyx_t_5 = ((__pyx_v_fdfden <= 0.0) != 0);
     if (unlikely(__pyx_t_5)) {
 
-      /* "mtrand.pyx":2189
+      /* "mtrand.pyx":2193
  *                 raise ValueError("dfnum <= 0")
  *             if fdfden <= 0:
  *                 raise ValueError("dfden <= 0")             # <<<<<<<<<<<<<<
  *             if fnonc < 0:
  *                 raise ValueError("nonc < 0")
  */
-      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2189, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2193, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __PYX_ERR(0, 2189, __pyx_L1_error)
+      __PYX_ERR(0, 2193, __pyx_L1_error)
 
-      /* "mtrand.pyx":2188
+      /* "mtrand.pyx":2192
  *             if fdfnum <= 0:
  *                 raise ValueError("dfnum <= 0")
  *             if fdfden <= 0:             # <<<<<<<<<<<<<<
@@ -23163,7 +23226,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_50noncentral_f(struct __pyx_obj_
  */
     }
 
-    /* "mtrand.pyx":2190
+    /* "mtrand.pyx":2194
  *             if fdfden <= 0:
  *                 raise ValueError("dfden <= 0")
  *             if fnonc < 0:             # <<<<<<<<<<<<<<
@@ -23173,20 +23236,20 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_50noncentral_f(struct __pyx_obj_
     __pyx_t_5 = ((__pyx_v_fnonc < 0.0) != 0);
     if (unlikely(__pyx_t_5)) {
 
-      /* "mtrand.pyx":2191
+      /* "mtrand.pyx":2195
  *                 raise ValueError("dfden <= 0")
  *             if fnonc < 0:
  *                 raise ValueError("nonc < 0")             # <<<<<<<<<<<<<<
  *             return cont3_array_sc(self.internal_state, rk_noncentral_f, size,
  *                                   fdfnum, fdfden, fnonc, self.lock)
  */
-      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2191, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2195, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __PYX_ERR(0, 2191, __pyx_L1_error)
+      __PYX_ERR(0, 2195, __pyx_L1_error)
 
-      /* "mtrand.pyx":2190
+      /* "mtrand.pyx":2194
  *             if fdfden <= 0:
  *                 raise ValueError("dfden <= 0")
  *             if fnonc < 0:             # <<<<<<<<<<<<<<
@@ -23195,7 +23258,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_50noncentral_f(struct __pyx_obj_
  */
     }
 
-    /* "mtrand.pyx":2192
+    /* "mtrand.pyx":2196
  *             if fnonc < 0:
  *                 raise ValueError("nonc < 0")
  *             return cont3_array_sc(self.internal_state, rk_noncentral_f, size,             # <<<<<<<<<<<<<<
@@ -23204,7 +23267,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_50noncentral_f(struct __pyx_obj_
  */
     __Pyx_XDECREF(__pyx_r);
 
-    /* "mtrand.pyx":2193
+    /* "mtrand.pyx":2197
  *                 raise ValueError("nonc < 0")
  *             return cont3_array_sc(self.internal_state, rk_noncentral_f, size,
  *                                   fdfnum, fdfden, fnonc, self.lock)             # <<<<<<<<<<<<<<
@@ -23214,21 +23277,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_50noncentral_f(struct __pyx_obj_
     __pyx_t_3 = __pyx_v_self->lock;
     __Pyx_INCREF(__pyx_t_3);
 
-    /* "mtrand.pyx":2192
+    /* "mtrand.pyx":2196
  *             if fnonc < 0:
  *                 raise ValueError("nonc < 0")
  *             return cont3_array_sc(self.internal_state, rk_noncentral_f, size,             # <<<<<<<<<<<<<<
  *                                   fdfnum, fdfden, fnonc, self.lock)
  * 
  */
-    __pyx_t_1 = __pyx_f_6mtrand_cont3_array_sc(__pyx_v_self->internal_state, rk_noncentral_f, __pyx_v_size, __pyx_v_fdfnum, __pyx_v_fdfden, __pyx_v_fnonc, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2192, __pyx_L1_error)
+    __pyx_t_1 = __pyx_f_6mtrand_cont3_array_sc(__pyx_v_self->internal_state, rk_noncentral_f, __pyx_v_size, __pyx_v_fdfnum, __pyx_v_fdfden, __pyx_v_fnonc, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2196, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __pyx_r = __pyx_t_1;
     __pyx_t_1 = 0;
     goto __pyx_L0;
 
-    /* "mtrand.pyx":2181
+    /* "mtrand.pyx":2185
  *         ononc = <ndarray>PyArray_FROM_OTF(nonc, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if odfnum.shape == odfden.shape == ononc.shape == ():             # <<<<<<<<<<<<<<
@@ -23237,21 +23300,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_50noncentral_f(struct __pyx_obj_
  */
   }
 
-  /* "mtrand.pyx":2195
+  /* "mtrand.pyx":2199
  *                                   fdfnum, fdfden, fnonc, self.lock)
  * 
  *         if np.any(np.less_equal(odfnum, 0.0)):             # <<<<<<<<<<<<<<
  *             raise ValueError("dfnum <= 0")
  *         if np.any(np.less_equal(odfden, 0.0)):
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2195, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2199, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_any); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2195, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_any); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2199, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2195, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2199, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_less_equal); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2195, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_less_equal); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2199, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   __pyx_t_4 = NULL;
@@ -23269,7 +23332,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_50noncentral_f(struct __pyx_obj_
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_7)) {
     PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_odfnum), __pyx_float_0_0};
-    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2195, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2199, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_GOTREF(__pyx_t_3);
   } else
@@ -23277,13 +23340,13 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_50noncentral_f(struct __pyx_obj_
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
     PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_odfnum), __pyx_float_0_0};
-    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2195, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2199, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_GOTREF(__pyx_t_3);
   } else
   #endif
   {
-    __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2195, __pyx_L1_error)
+    __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2199, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_9);
     if (__pyx_t_4) {
       __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); __pyx_t_4 = NULL;
@@ -23294,7 +23357,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_50noncentral_f(struct __pyx_obj_
     __Pyx_INCREF(__pyx_float_0_0);
     __Pyx_GIVEREF(__pyx_float_0_0);
     PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_float_0_0);
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2195, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2199, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
   }
@@ -23312,27 +23375,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_50noncentral_f(struct __pyx_obj_
   __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
   __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2195, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2199, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2195, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2199, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (unlikely(__pyx_t_5)) {
 
-    /* "mtrand.pyx":2196
+    /* "mtrand.pyx":2200
  * 
  *         if np.any(np.less_equal(odfnum, 0.0)):
  *             raise ValueError("dfnum <= 0")             # <<<<<<<<<<<<<<
  *         if np.any(np.less_equal(odfden, 0.0)):
  *             raise ValueError("dfden <= 0")
  */
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2196, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2200, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __PYX_ERR(0, 2196, __pyx_L1_error)
+    __PYX_ERR(0, 2200, __pyx_L1_error)
 
-    /* "mtrand.pyx":2195
+    /* "mtrand.pyx":2199
  *                                   fdfnum, fdfden, fnonc, self.lock)
  * 
  *         if np.any(np.less_equal(odfnum, 0.0)):             # <<<<<<<<<<<<<<
@@ -23341,21 +23404,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_50noncentral_f(struct __pyx_obj_
  */
   }
 
-  /* "mtrand.pyx":2197
+  /* "mtrand.pyx":2201
  *         if np.any(np.less_equal(odfnum, 0.0)):
  *             raise ValueError("dfnum <= 0")
  *         if np.any(np.less_equal(odfden, 0.0)):             # <<<<<<<<<<<<<<
  *             raise ValueError("dfden <= 0")
  *         if np.any(np.less(ononc, 0.0)):
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2197, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2201, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_any); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2197, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_any); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2201, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2197, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2201, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_less_equal); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2197, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_less_equal); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2201, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   __pyx_t_7 = NULL;
@@ -23373,7 +23436,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_50noncentral_f(struct __pyx_obj_
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_9)) {
     PyObject *__pyx_temp[3] = {__pyx_t_7, ((PyObject *)__pyx_v_odfden), __pyx_float_0_0};
-    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2197, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2201, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
     __Pyx_GOTREF(__pyx_t_2);
   } else
@@ -23381,13 +23444,13 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_50noncentral_f(struct __pyx_obj_
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
     PyObject *__pyx_temp[3] = {__pyx_t_7, ((PyObject *)__pyx_v_odfden), __pyx_float_0_0};
-    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2197, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2201, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
     __Pyx_GOTREF(__pyx_t_2);
   } else
   #endif
   {
-    __pyx_t_4 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2197, __pyx_L1_error)
+    __pyx_t_4 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2201, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     if (__pyx_t_7) {
       __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7); __pyx_t_7 = NULL;
@@ -23398,7 +23461,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_50noncentral_f(struct __pyx_obj_
     __Pyx_INCREF(__pyx_float_0_0);
     __Pyx_GIVEREF(__pyx_float_0_0);
     PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_8, __pyx_float_0_0);
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2197, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2201, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   }
@@ -23416,27 +23479,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_50noncentral_f(struct __pyx_obj_
   __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_9, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
   __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2197, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2201, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2197, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2201, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (unlikely(__pyx_t_5)) {
 
-    /* "mtrand.pyx":2198
+    /* "mtrand.pyx":2202
  *             raise ValueError("dfnum <= 0")
  *         if np.any(np.less_equal(odfden, 0.0)):
  *             raise ValueError("dfden <= 0")             # <<<<<<<<<<<<<<
  *         if np.any(np.less(ononc, 0.0)):
  *             raise ValueError("nonc < 0")
  */
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2198, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2202, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __PYX_ERR(0, 2198, __pyx_L1_error)
+    __PYX_ERR(0, 2202, __pyx_L1_error)
 
-    /* "mtrand.pyx":2197
+    /* "mtrand.pyx":2201
  *         if np.any(np.less_equal(odfnum, 0.0)):
  *             raise ValueError("dfnum <= 0")
  *         if np.any(np.less_equal(odfden, 0.0)):             # <<<<<<<<<<<<<<
@@ -23445,21 +23508,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_50noncentral_f(struct __pyx_obj_
  */
   }
 
-  /* "mtrand.pyx":2199
+  /* "mtrand.pyx":2203
  *         if np.any(np.less_equal(odfden, 0.0)):
  *             raise ValueError("dfden <= 0")
  *         if np.any(np.less(ononc, 0.0)):             # <<<<<<<<<<<<<<
  *             raise ValueError("nonc < 0")
  *         return cont3_array(self.internal_state, rk_noncentral_f, size, odfnum,
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2199, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2203, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_any); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2199, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_any); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2203, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2199, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2203, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_less); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2199, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_less); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2203, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
   __pyx_t_9 = NULL;
@@ -23477,7 +23540,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_50noncentral_f(struct __pyx_obj_
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_4)) {
     PyObject *__pyx_temp[3] = {__pyx_t_9, ((PyObject *)__pyx_v_ononc), __pyx_float_0_0};
-    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2199, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2203, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
     __Pyx_GOTREF(__pyx_t_3);
   } else
@@ -23485,13 +23548,13 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_50noncentral_f(struct __pyx_obj_
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
     PyObject *__pyx_temp[3] = {__pyx_t_9, ((PyObject *)__pyx_v_ononc), __pyx_float_0_0};
-    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2199, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2203, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
     __Pyx_GOTREF(__pyx_t_3);
   } else
   #endif
   {
-    __pyx_t_7 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2199, __pyx_L1_error)
+    __pyx_t_7 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2203, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_7);
     if (__pyx_t_9) {
       __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9); __pyx_t_9 = NULL;
@@ -23502,7 +23565,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_50noncentral_f(struct __pyx_obj_
     __Pyx_INCREF(__pyx_float_0_0);
     __Pyx_GIVEREF(__pyx_float_0_0);
     PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_float_0_0);
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2199, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2203, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   }
@@ -23520,27 +23583,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_50noncentral_f(struct __pyx_obj_
   __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2199, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2203, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2199, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2203, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (unlikely(__pyx_t_5)) {
 
-    /* "mtrand.pyx":2200
+    /* "mtrand.pyx":2204
  *             raise ValueError("dfden <= 0")
  *         if np.any(np.less(ononc, 0.0)):
  *             raise ValueError("nonc < 0")             # <<<<<<<<<<<<<<
  *         return cont3_array(self.internal_state, rk_noncentral_f, size, odfnum,
  *                            odfden, ononc, self.lock)
  */
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2200, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2204, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __PYX_ERR(0, 2200, __pyx_L1_error)
+    __PYX_ERR(0, 2204, __pyx_L1_error)
 
-    /* "mtrand.pyx":2199
+    /* "mtrand.pyx":2203
  *         if np.any(np.less_equal(odfden, 0.0)):
  *             raise ValueError("dfden <= 0")
  *         if np.any(np.less(ononc, 0.0)):             # <<<<<<<<<<<<<<
@@ -23549,7 +23612,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_50noncentral_f(struct __pyx_obj_
  */
   }
 
-  /* "mtrand.pyx":2201
+  /* "mtrand.pyx":2205
  *         if np.any(np.less(ononc, 0.0)):
  *             raise ValueError("nonc < 0")
  *         return cont3_array(self.internal_state, rk_noncentral_f, size, odfnum,             # <<<<<<<<<<<<<<
@@ -23558,7 +23621,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_50noncentral_f(struct __pyx_obj_
  */
   __Pyx_XDECREF(__pyx_r);
 
-  /* "mtrand.pyx":2202
+  /* "mtrand.pyx":2206
  *             raise ValueError("nonc < 0")
  *         return cont3_array(self.internal_state, rk_noncentral_f, size, odfnum,
  *                            odfden, ononc, self.lock)             # <<<<<<<<<<<<<<
@@ -23568,21 +23631,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_50noncentral_f(struct __pyx_obj_
   __pyx_t_1 = __pyx_v_self->lock;
   __Pyx_INCREF(__pyx_t_1);
 
-  /* "mtrand.pyx":2201
+  /* "mtrand.pyx":2205
  *         if np.any(np.less(ononc, 0.0)):
  *             raise ValueError("nonc < 0")
  *         return cont3_array(self.internal_state, rk_noncentral_f, size, odfnum,             # <<<<<<<<<<<<<<
  *                            odfden, ononc, self.lock)
  * 
  */
-  __pyx_t_2 = __pyx_f_6mtrand_cont3_array(__pyx_v_self->internal_state, rk_noncentral_f, __pyx_v_size, __pyx_v_odfnum, __pyx_v_odfden, __pyx_v_ononc, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2201, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_6mtrand_cont3_array(__pyx_v_self->internal_state, rk_noncentral_f, __pyx_v_size, __pyx_v_odfnum, __pyx_v_odfden, __pyx_v_ononc, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2205, __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;
 
-  /* "mtrand.pyx":2103
+  /* "mtrand.pyx":2106
  *                            self.lock)
  * 
  *     def noncentral_f(self, dfnum, dfden, nonc, size=None):             # <<<<<<<<<<<<<<
@@ -23609,7 +23672,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_50noncentral_f(struct __pyx_obj_
   return __pyx_r;
 }
 
-/* "mtrand.pyx":2204
+/* "mtrand.pyx":2208
  *                            odfden, ononc, self.lock)
  * 
  *     def chisquare(self, df, size=None):             # <<<<<<<<<<<<<<
@@ -23654,7 +23717,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_53chisquare(PyObject *__pyx_v_se
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "chisquare") < 0)) __PYX_ERR(0, 2204, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "chisquare") < 0)) __PYX_ERR(0, 2208, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -23670,7 +23733,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_53chisquare(PyObject *__pyx_v_se
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("chisquare", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2204, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("chisquare", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2208, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("mtrand.RandomState.chisquare", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -23699,14 +23762,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_52chisquare(struct __pyx_obj_6mt
   PyObject *__pyx_t_9 = NULL;
   __Pyx_RefNannySetupContext("chisquare", 0);
 
-  /* "mtrand.pyx":2270
+  /* "mtrand.pyx":2274
  *         cdef double fdf
  * 
  *         odf = <ndarray>PyArray_FROM_OTF(df, NPY_DOUBLE, NPY_ARRAY_ALIGNED)             # <<<<<<<<<<<<<<
  * 
  *         if odf.shape == ():
  */
-  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_df, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2270, __pyx_L1_error)
+  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_df, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2274, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_2 = __pyx_t_1;
   __Pyx_INCREF(__pyx_t_2);
@@ -23714,32 +23777,32 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_52chisquare(struct __pyx_obj_6mt
   __pyx_v_odf = ((PyArrayObject *)__pyx_t_2);
   __pyx_t_2 = 0;
 
-  /* "mtrand.pyx":2272
+  /* "mtrand.pyx":2276
  *         odf = <ndarray>PyArray_FROM_OTF(df, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if odf.shape == ():             # <<<<<<<<<<<<<<
  *             fdf = PyFloat_AsDouble(df)
  * 
  */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_odf), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2272, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_odf), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2276, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2272, __pyx_L1_error)
+  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2276, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2272, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2276, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (__pyx_t_3) {
 
-    /* "mtrand.pyx":2273
+    /* "mtrand.pyx":2277
  * 
  *         if odf.shape == ():
  *             fdf = PyFloat_AsDouble(df)             # <<<<<<<<<<<<<<
  * 
  *             if fdf <= 0:
  */
-    __pyx_t_4 = PyFloat_AsDouble(__pyx_v_df); if (unlikely(__pyx_t_4 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 2273, __pyx_L1_error)
+    __pyx_t_4 = PyFloat_AsDouble(__pyx_v_df); if (unlikely(__pyx_t_4 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 2277, __pyx_L1_error)
     __pyx_v_fdf = __pyx_t_4;
 
-    /* "mtrand.pyx":2275
+    /* "mtrand.pyx":2279
  *             fdf = PyFloat_AsDouble(df)
  * 
  *             if fdf <= 0:             # <<<<<<<<<<<<<<
@@ -23749,20 +23812,20 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_52chisquare(struct __pyx_obj_6mt
     __pyx_t_3 = ((__pyx_v_fdf <= 0.0) != 0);
     if (unlikely(__pyx_t_3)) {
 
-      /* "mtrand.pyx":2276
+      /* "mtrand.pyx":2280
  * 
  *             if fdf <= 0:
  *                 raise ValueError("df <= 0")             # <<<<<<<<<<<<<<
  *             return cont1_array_sc(self.internal_state, rk_chisquare, size, fdf,
  *                                   self.lock)
  */
-      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2276, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2280, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_Raise(__pyx_t_1, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __PYX_ERR(0, 2276, __pyx_L1_error)
+      __PYX_ERR(0, 2280, __pyx_L1_error)
 
-      /* "mtrand.pyx":2275
+      /* "mtrand.pyx":2279
  *             fdf = PyFloat_AsDouble(df)
  * 
  *             if fdf <= 0:             # <<<<<<<<<<<<<<
@@ -23771,7 +23834,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_52chisquare(struct __pyx_obj_6mt
  */
     }
 
-    /* "mtrand.pyx":2277
+    /* "mtrand.pyx":2281
  *             if fdf <= 0:
  *                 raise ValueError("df <= 0")
  *             return cont1_array_sc(self.internal_state, rk_chisquare, size, fdf,             # <<<<<<<<<<<<<<
@@ -23780,7 +23843,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_52chisquare(struct __pyx_obj_6mt
  */
     __Pyx_XDECREF(__pyx_r);
 
-    /* "mtrand.pyx":2278
+    /* "mtrand.pyx":2282
  *                 raise ValueError("df <= 0")
  *             return cont1_array_sc(self.internal_state, rk_chisquare, size, fdf,
  *                                   self.lock)             # <<<<<<<<<<<<<<
@@ -23790,21 +23853,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_52chisquare(struct __pyx_obj_6mt
     __pyx_t_1 = __pyx_v_self->lock;
     __Pyx_INCREF(__pyx_t_1);
 
-    /* "mtrand.pyx":2277
+    /* "mtrand.pyx":2281
  *             if fdf <= 0:
  *                 raise ValueError("df <= 0")
  *             return cont1_array_sc(self.internal_state, rk_chisquare, size, fdf,             # <<<<<<<<<<<<<<
  *                                   self.lock)
  * 
  */
-    __pyx_t_2 = __pyx_f_6mtrand_cont1_array_sc(__pyx_v_self->internal_state, rk_chisquare, __pyx_v_size, __pyx_v_fdf, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2277, __pyx_L1_error)
+    __pyx_t_2 = __pyx_f_6mtrand_cont1_array_sc(__pyx_v_self->internal_state, rk_chisquare, __pyx_v_size, __pyx_v_fdf, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2281, __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;
 
-    /* "mtrand.pyx":2272
+    /* "mtrand.pyx":2276
  *         odf = <ndarray>PyArray_FROM_OTF(df, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if odf.shape == ():             # <<<<<<<<<<<<<<
@@ -23813,21 +23876,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_52chisquare(struct __pyx_obj_6mt
  */
   }
 
-  /* "mtrand.pyx":2280
+  /* "mtrand.pyx":2284
  *                                   self.lock)
  * 
  *         if np.any(np.less_equal(odf, 0.0)):             # <<<<<<<<<<<<<<
  *             raise ValueError("df <= 0")
  *         return cont1_array(self.internal_state, rk_chisquare, size, odf,
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2280, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2284, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_any); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2280, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_any); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2284, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2280, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2284, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_less_equal); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2280, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_less_equal); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2284, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   __pyx_t_6 = NULL;
@@ -23845,7 +23908,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_52chisquare(struct __pyx_obj_6mt
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_7)) {
     PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_v_odf), __pyx_float_0_0};
-    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2280, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2284, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
@@ -23853,13 +23916,13 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_52chisquare(struct __pyx_obj_6mt
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
     PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_v_odf), __pyx_float_0_0};
-    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2280, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2284, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
   #endif
   {
-    __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2280, __pyx_L1_error)
+    __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2284, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_9);
     if (__pyx_t_6) {
       __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL;
@@ -23870,7 +23933,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_52chisquare(struct __pyx_obj_6mt
     __Pyx_INCREF(__pyx_float_0_0);
     __Pyx_GIVEREF(__pyx_float_0_0);
     PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_float_0_0);
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2280, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2284, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
   }
@@ -23888,27 +23951,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_52chisquare(struct __pyx_obj_6mt
   __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1);
   __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2280, __pyx_L1_error)
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2284, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2280, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2284, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (unlikely(__pyx_t_3)) {
 
-    /* "mtrand.pyx":2281
+    /* "mtrand.pyx":2285
  * 
  *         if np.any(np.less_equal(odf, 0.0)):
  *             raise ValueError("df <= 0")             # <<<<<<<<<<<<<<
  *         return cont1_array(self.internal_state, rk_chisquare, size, odf,
  *                            self.lock)
  */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2281, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2285, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __PYX_ERR(0, 2281, __pyx_L1_error)
+    __PYX_ERR(0, 2285, __pyx_L1_error)
 
-    /* "mtrand.pyx":2280
+    /* "mtrand.pyx":2284
  *                                   self.lock)
  * 
  *         if np.any(np.less_equal(odf, 0.0)):             # <<<<<<<<<<<<<<
@@ -23917,7 +23980,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_52chisquare(struct __pyx_obj_6mt
  */
   }
 
-  /* "mtrand.pyx":2282
+  /* "mtrand.pyx":2286
  *         if np.any(np.less_equal(odf, 0.0)):
  *             raise ValueError("df <= 0")
  *         return cont1_array(self.internal_state, rk_chisquare, size, odf,             # <<<<<<<<<<<<<<
@@ -23926,7 +23989,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_52chisquare(struct __pyx_obj_6mt
  */
   __Pyx_XDECREF(__pyx_r);
 
-  /* "mtrand.pyx":2283
+  /* "mtrand.pyx":2287
  *             raise ValueError("df <= 0")
  *         return cont1_array(self.internal_state, rk_chisquare, size, odf,
  *                            self.lock)             # <<<<<<<<<<<<<<
@@ -23936,21 +23999,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_52chisquare(struct __pyx_obj_6mt
   __pyx_t_2 = __pyx_v_self->lock;
   __Pyx_INCREF(__pyx_t_2);
 
-  /* "mtrand.pyx":2282
+  /* "mtrand.pyx":2286
  *         if np.any(np.less_equal(odf, 0.0)):
  *             raise ValueError("df <= 0")
  *         return cont1_array(self.internal_state, rk_chisquare, size, odf,             # <<<<<<<<<<<<<<
  *                            self.lock)
  * 
  */
-  __pyx_t_5 = __pyx_f_6mtrand_cont1_array(__pyx_v_self->internal_state, rk_chisquare, __pyx_v_size, __pyx_v_odf, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2282, __pyx_L1_error)
+  __pyx_t_5 = __pyx_f_6mtrand_cont1_array(__pyx_v_self->internal_state, rk_chisquare, __pyx_v_size, __pyx_v_odf, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2286, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_r = __pyx_t_5;
   __pyx_t_5 = 0;
   goto __pyx_L0;
 
-  /* "mtrand.pyx":2204
+  /* "mtrand.pyx":2208
  *                            odfden, ononc, self.lock)
  * 
  *     def chisquare(self, df, size=None):             # <<<<<<<<<<<<<<
@@ -23975,7 +24038,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_52chisquare(struct __pyx_obj_6mt
   return __pyx_r;
 }
 
-/* "mtrand.pyx":2285
+/* "mtrand.pyx":2289
  *                            self.lock)
  * 
  *     def noncentral_chisquare(self, df, nonc, size=None):             # <<<<<<<<<<<<<<
@@ -24019,7 +24082,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_55noncentral_chisquare(PyObject
         case  1:
         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nonc)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("noncentral_chisquare", 0, 2, 3, 1); __PYX_ERR(0, 2285, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("noncentral_chisquare", 0, 2, 3, 1); __PYX_ERR(0, 2289, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  2:
@@ -24029,7 +24092,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_55noncentral_chisquare(PyObject
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "noncentral_chisquare") < 0)) __PYX_ERR(0, 2285, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "noncentral_chisquare") < 0)) __PYX_ERR(0, 2289, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -24047,7 +24110,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_55noncentral_chisquare(PyObject
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("noncentral_chisquare", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2285, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("noncentral_chisquare", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2289, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("mtrand.RandomState.noncentral_chisquare", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -24078,14 +24141,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_54noncentral_chisquare(struct __
   PyObject *__pyx_t_9 = NULL;
   __Pyx_RefNannySetupContext("noncentral_chisquare", 0);
 
-  /* "mtrand.pyx":2370
+  /* "mtrand.pyx":2374
  *         cdef double fdf, fnonc
  * 
  *         odf = <ndarray>PyArray_FROM_OTF(df, NPY_DOUBLE, NPY_ARRAY_ALIGNED)             # <<<<<<<<<<<<<<
  *         ononc = <ndarray>PyArray_FROM_OTF(nonc, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  */
-  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_df, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2370, __pyx_L1_error)
+  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_df, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2374, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_2 = __pyx_t_1;
   __Pyx_INCREF(__pyx_t_2);
@@ -24093,14 +24156,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_54noncentral_chisquare(struct __
   __pyx_v_odf = ((PyArrayObject *)__pyx_t_2);
   __pyx_t_2 = 0;
 
-  /* "mtrand.pyx":2371
+  /* "mtrand.pyx":2375
  * 
  *         odf = <ndarray>PyArray_FROM_OTF(df, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  *         ononc = <ndarray>PyArray_FROM_OTF(nonc, NPY_DOUBLE, NPY_ARRAY_ALIGNED)             # <<<<<<<<<<<<<<
  * 
  *         if odf.shape == ononc.shape == ():
  */
-  __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_nonc, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2371, __pyx_L1_error)
+  __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_nonc, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2375, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_1 = __pyx_t_2;
   __Pyx_INCREF(__pyx_t_1);
@@ -24108,49 +24171,49 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_54noncentral_chisquare(struct __
   __pyx_v_ononc = ((PyArrayObject *)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "mtrand.pyx":2373
+  /* "mtrand.pyx":2377
  *         ononc = <ndarray>PyArray_FROM_OTF(nonc, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if odf.shape == ononc.shape == ():             # <<<<<<<<<<<<<<
  *             fdf = PyFloat_AsDouble(df)
  *             fnonc = PyFloat_AsDouble(nonc)
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_odf), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2373, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_odf), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2377, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ononc), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2373, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ononc), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2377, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2373, __pyx_L1_error)
+  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2377, __pyx_L1_error)
   if (__Pyx_PyObject_IsTrue(__pyx_t_3)) {
     __Pyx_DECREF(__pyx_t_3);
-    __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2373, __pyx_L1_error)
+    __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2377, __pyx_L1_error)
   }
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2373, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2377, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   if (__pyx_t_4) {
 
-    /* "mtrand.pyx":2374
+    /* "mtrand.pyx":2378
  * 
  *         if odf.shape == ononc.shape == ():
  *             fdf = PyFloat_AsDouble(df)             # <<<<<<<<<<<<<<
  *             fnonc = PyFloat_AsDouble(nonc)
  * 
  */
-    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_df); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 2374, __pyx_L1_error)
+    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_df); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 2378, __pyx_L1_error)
     __pyx_v_fdf = __pyx_t_5;
 
-    /* "mtrand.pyx":2375
+    /* "mtrand.pyx":2379
  *         if odf.shape == ononc.shape == ():
  *             fdf = PyFloat_AsDouble(df)
  *             fnonc = PyFloat_AsDouble(nonc)             # <<<<<<<<<<<<<<
  * 
  *             if fdf <= 0:
  */
-    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_nonc); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 2375, __pyx_L1_error)
+    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_nonc); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 2379, __pyx_L1_error)
     __pyx_v_fnonc = __pyx_t_5;
 
-    /* "mtrand.pyx":2377
+    /* "mtrand.pyx":2381
  *             fnonc = PyFloat_AsDouble(nonc)
  * 
  *             if fdf <= 0:             # <<<<<<<<<<<<<<
@@ -24160,20 +24223,20 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_54noncentral_chisquare(struct __
     __pyx_t_4 = ((__pyx_v_fdf <= 0.0) != 0);
     if (unlikely(__pyx_t_4)) {
 
-      /* "mtrand.pyx":2378
+      /* "mtrand.pyx":2382
  * 
  *             if fdf <= 0:
  *                 raise ValueError("df <= 0")             # <<<<<<<<<<<<<<
  *             if fnonc < 0:
  *                 raise ValueError("nonc < 0")
  */
-      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2378, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2382, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __PYX_ERR(0, 2378, __pyx_L1_error)
+      __PYX_ERR(0, 2382, __pyx_L1_error)
 
-      /* "mtrand.pyx":2377
+      /* "mtrand.pyx":2381
  *             fnonc = PyFloat_AsDouble(nonc)
  * 
  *             if fdf <= 0:             # <<<<<<<<<<<<<<
@@ -24182,7 +24245,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_54noncentral_chisquare(struct __
  */
     }
 
-    /* "mtrand.pyx":2379
+    /* "mtrand.pyx":2383
  *             if fdf <= 0:
  *                 raise ValueError("df <= 0")
  *             if fnonc < 0:             # <<<<<<<<<<<<<<
@@ -24192,20 +24255,20 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_54noncentral_chisquare(struct __
     __pyx_t_4 = ((__pyx_v_fnonc < 0.0) != 0);
     if (unlikely(__pyx_t_4)) {
 
-      /* "mtrand.pyx":2380
+      /* "mtrand.pyx":2384
  *                 raise ValueError("df <= 0")
  *             if fnonc < 0:
  *                 raise ValueError("nonc < 0")             # <<<<<<<<<<<<<<
  *             return cont2_array_sc(self.internal_state, rk_noncentral_chisquare,
  *                                   size, fdf, fnonc, self.lock)
  */
-      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2380, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2384, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __PYX_ERR(0, 2380, __pyx_L1_error)
+      __PYX_ERR(0, 2384, __pyx_L1_error)
 
-      /* "mtrand.pyx":2379
+      /* "mtrand.pyx":2383
  *             if fdf <= 0:
  *                 raise ValueError("df <= 0")
  *             if fnonc < 0:             # <<<<<<<<<<<<<<
@@ -24214,7 +24277,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_54noncentral_chisquare(struct __
  */
     }
 
-    /* "mtrand.pyx":2381
+    /* "mtrand.pyx":2385
  *             if fnonc < 0:
  *                 raise ValueError("nonc < 0")
  *             return cont2_array_sc(self.internal_state, rk_noncentral_chisquare,             # <<<<<<<<<<<<<<
@@ -24223,7 +24286,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_54noncentral_chisquare(struct __
  */
     __Pyx_XDECREF(__pyx_r);
 
-    /* "mtrand.pyx":2382
+    /* "mtrand.pyx":2386
  *                 raise ValueError("nonc < 0")
  *             return cont2_array_sc(self.internal_state, rk_noncentral_chisquare,
  *                                   size, fdf, fnonc, self.lock)             # <<<<<<<<<<<<<<
@@ -24233,21 +24296,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_54noncentral_chisquare(struct __
     __pyx_t_3 = __pyx_v_self->lock;
     __Pyx_INCREF(__pyx_t_3);
 
-    /* "mtrand.pyx":2381
+    /* "mtrand.pyx":2385
  *             if fnonc < 0:
  *                 raise ValueError("nonc < 0")
  *             return cont2_array_sc(self.internal_state, rk_noncentral_chisquare,             # <<<<<<<<<<<<<<
  *                                   size, fdf, fnonc, self.lock)
  * 
  */
-    __pyx_t_2 = __pyx_f_6mtrand_cont2_array_sc(__pyx_v_self->internal_state, rk_noncentral_chisquare, __pyx_v_size, __pyx_v_fdf, __pyx_v_fnonc, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2381, __pyx_L1_error)
+    __pyx_t_2 = __pyx_f_6mtrand_cont2_array_sc(__pyx_v_self->internal_state, rk_noncentral_chisquare, __pyx_v_size, __pyx_v_fdf, __pyx_v_fnonc, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2385, __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;
 
-    /* "mtrand.pyx":2373
+    /* "mtrand.pyx":2377
  *         ononc = <ndarray>PyArray_FROM_OTF(nonc, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if odf.shape == ononc.shape == ():             # <<<<<<<<<<<<<<
@@ -24256,21 +24319,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_54noncentral_chisquare(struct __
  */
   }
 
-  /* "mtrand.pyx":2384
+  /* "mtrand.pyx":2388
  *                                   size, fdf, fnonc, self.lock)
  * 
  *         if np.any(np.less_equal(odf, 0.0)):             # <<<<<<<<<<<<<<
  *             raise ValueError("df <= 0")
  *         if np.any(np.less(ononc, 0.0)):
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2384, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2388, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_any); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2384, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_any); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2388, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2384, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2388, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_less_equal); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2384, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_less_equal); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2388, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   __pyx_t_6 = NULL;
@@ -24288,7 +24351,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_54noncentral_chisquare(struct __
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_7)) {
     PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_v_odf), __pyx_float_0_0};
-    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2384, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2388, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_GOTREF(__pyx_t_3);
   } else
@@ -24296,13 +24359,13 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_54noncentral_chisquare(struct __
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
     PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_v_odf), __pyx_float_0_0};
-    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2384, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2388, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_GOTREF(__pyx_t_3);
   } else
   #endif
   {
-    __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2384, __pyx_L1_error)
+    __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2388, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_9);
     if (__pyx_t_6) {
       __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL;
@@ -24313,7 +24376,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_54noncentral_chisquare(struct __
     __Pyx_INCREF(__pyx_float_0_0);
     __Pyx_GIVEREF(__pyx_float_0_0);
     PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_float_0_0);
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2384, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2388, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
   }
@@ -24331,27 +24394,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_54noncentral_chisquare(struct __
   __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_7, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3);
   __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2384, __pyx_L1_error)
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2388, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2384, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2388, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (unlikely(__pyx_t_4)) {
 
-    /* "mtrand.pyx":2385
+    /* "mtrand.pyx":2389
  * 
  *         if np.any(np.less_equal(odf, 0.0)):
  *             raise ValueError("df <= 0")             # <<<<<<<<<<<<<<
  *         if np.any(np.less(ononc, 0.0)):
  *             raise ValueError("nonc < 0")
  */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2385, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2389, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __PYX_ERR(0, 2385, __pyx_L1_error)
+    __PYX_ERR(0, 2389, __pyx_L1_error)
 
-    /* "mtrand.pyx":2384
+    /* "mtrand.pyx":2388
  *                                   size, fdf, fnonc, self.lock)
  * 
  *         if np.any(np.less_equal(odf, 0.0)):             # <<<<<<<<<<<<<<
@@ -24360,21 +24423,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_54noncentral_chisquare(struct __
  */
   }
 
-  /* "mtrand.pyx":2386
+  /* "mtrand.pyx":2390
  *         if np.any(np.less_equal(odf, 0.0)):
  *             raise ValueError("df <= 0")
  *         if np.any(np.less(ononc, 0.0)):             # <<<<<<<<<<<<<<
  *             raise ValueError("nonc < 0")
  *         return cont2_array(self.internal_state, rk_noncentral_chisquare, size,
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2386, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2390, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_any); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2386, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_any); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2390, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2386, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2390, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_less); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2386, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_less); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2390, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   __pyx_t_7 = NULL;
@@ -24392,7 +24455,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_54noncentral_chisquare(struct __
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_9)) {
     PyObject *__pyx_temp[3] = {__pyx_t_7, ((PyObject *)__pyx_v_ononc), __pyx_float_0_0};
-    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2386, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2390, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
@@ -24400,13 +24463,13 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_54noncentral_chisquare(struct __
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
     PyObject *__pyx_temp[3] = {__pyx_t_7, ((PyObject *)__pyx_v_ononc), __pyx_float_0_0};
-    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2386, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2390, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
   #endif
   {
-    __pyx_t_6 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2386, __pyx_L1_error)
+    __pyx_t_6 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2390, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     if (__pyx_t_7) {
       __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = NULL;
@@ -24417,7 +24480,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_54noncentral_chisquare(struct __
     __Pyx_INCREF(__pyx_float_0_0);
     __Pyx_GIVEREF(__pyx_float_0_0);
     PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_float_0_0);
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2386, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2390, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   }
@@ -24435,27 +24498,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_54noncentral_chisquare(struct __
   __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_9, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1);
   __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2386, __pyx_L1_error)
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2390, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2386, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2390, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (unlikely(__pyx_t_4)) {
 
-    /* "mtrand.pyx":2387
+    /* "mtrand.pyx":2391
  *             raise ValueError("df <= 0")
  *         if np.any(np.less(ononc, 0.0)):
  *             raise ValueError("nonc < 0")             # <<<<<<<<<<<<<<
  *         return cont2_array(self.internal_state, rk_noncentral_chisquare, size,
  *                            odf, ononc, self.lock)
  */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2387, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2391, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __PYX_ERR(0, 2387, __pyx_L1_error)
+    __PYX_ERR(0, 2391, __pyx_L1_error)
 
-    /* "mtrand.pyx":2386
+    /* "mtrand.pyx":2390
  *         if np.any(np.less_equal(odf, 0.0)):
  *             raise ValueError("df <= 0")
  *         if np.any(np.less(ononc, 0.0)):             # <<<<<<<<<<<<<<
@@ -24464,7 +24527,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_54noncentral_chisquare(struct __
  */
   }
 
-  /* "mtrand.pyx":2388
+  /* "mtrand.pyx":2392
  *         if np.any(np.less(ononc, 0.0)):
  *             raise ValueError("nonc < 0")
  *         return cont2_array(self.internal_state, rk_noncentral_chisquare, size,             # <<<<<<<<<<<<<<
@@ -24473,7 +24536,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_54noncentral_chisquare(struct __
  */
   __Pyx_XDECREF(__pyx_r);
 
-  /* "mtrand.pyx":2389
+  /* "mtrand.pyx":2393
  *             raise ValueError("nonc < 0")
  *         return cont2_array(self.internal_state, rk_noncentral_chisquare, size,
  *                            odf, ononc, self.lock)             # <<<<<<<<<<<<<<
@@ -24483,21 +24546,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_54noncentral_chisquare(struct __
   __pyx_t_2 = __pyx_v_self->lock;
   __Pyx_INCREF(__pyx_t_2);
 
-  /* "mtrand.pyx":2388
+  /* "mtrand.pyx":2392
  *         if np.any(np.less(ononc, 0.0)):
  *             raise ValueError("nonc < 0")
  *         return cont2_array(self.internal_state, rk_noncentral_chisquare, size,             # <<<<<<<<<<<<<<
  *                            odf, ononc, self.lock)
  * 
  */
-  __pyx_t_3 = __pyx_f_6mtrand_cont2_array(__pyx_v_self->internal_state, rk_noncentral_chisquare, __pyx_v_size, __pyx_v_odf, __pyx_v_ononc, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2388, __pyx_L1_error)
+  __pyx_t_3 = __pyx_f_6mtrand_cont2_array(__pyx_v_self->internal_state, rk_noncentral_chisquare, __pyx_v_size, __pyx_v_odf, __pyx_v_ononc, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2392, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_r = __pyx_t_3;
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  /* "mtrand.pyx":2285
+  /* "mtrand.pyx":2289
  *                            self.lock)
  * 
  *     def noncentral_chisquare(self, df, nonc, size=None):             # <<<<<<<<<<<<<<
@@ -24523,7 +24586,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_54noncentral_chisquare(struct __
   return __pyx_r;
 }
 
-/* "mtrand.pyx":2391
+/* "mtrand.pyx":2395
  *                            odf, ononc, self.lock)
  * 
  *     def standard_cauchy(self, size=None):             # <<<<<<<<<<<<<<
@@ -24533,7 +24596,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_54noncentral_chisquare(struct __
 
 /* Python wrapper */
 static PyObject *__pyx_pw_6mtrand_11RandomState_57standard_cauchy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_56standard_cauchy[] = "\n        standard_cauchy(size=None)\n\n        Draw samples from a standard Cauchy distribution with mode = 0.\n\n        Also known as the Lorentz distribution.\n\n        Parameters\n        ----------\n        size : int or tuple of ints, optional\n            Output shape.  If the given shape is, e.g., ``(m, n, k)``, then\n            ``m * n * k`` samples are drawn.  Default is None, in which case a\n            single value is returned.\n\n        Returns\n        -------\n        samples : ndarray or scalar\n            The drawn samples.\n\n        Notes\n        -----\n        The probability density function for the full Cauchy distribution is\n\n        .. math:: P(x; x_0, \\gamma) = \\frac{1}{\\pi \\gamma \\bigl[ 1+\n                  (\\frac{x-x_0}{\\gamma})^2 \\bigr] }\n\n        and the Standard Cauchy distribution just sets :math:`x_0=0` and\n        :math:`\\gamma=1`\n\n        The Cauchy distribution arises in the solution to the driven harmonic\n        oscillator problem, and also describes spectral line broadening. It\n        also describes the distribution of values at which a line tilted at\n        a random angle will cut the x axis.\n\n        When studying hypothesis tests that assume normality, seeing how the\n        tests perform on data from a Cauchy distribution is a good indicator of\n        their sensitivity to a heavy-tailed distribution, since the Cauchy looks\n        very much like a Gaussian distribution, but with heavier tails.\n\n        References\n        ----------\n        .. [1] NIST/SEMATECH e-Handbook of Statistical Methods, \"Cauchy\n              Distribution\",\n              https://www.itl.nist.gov/div898/handbook/eda/section3/eda3663.htm\n        .. [2] Weisstein, Eric W. \"Cauchy Distribution.\" From MathWorld--A\n              Wolfram Web Resource.\n              http://mathworld.wolfram.com/CauchyDistribution.html\n        .. [3] Wikipedia, \"Cauchy distribution\"\n              https://en.wikipedia.org/wiki""/Cauchy_distribution\n\n        Examples\n        --------\n        Draw samples and plot the distribution:\n\n        >>> s = np.random.standard_cauchy(1000000)\n        >>> s = s[(s>-25) & (s<25)]  # truncate distribution so it plots well\n        >>> plt.hist(s, bins=100)\n        >>> plt.show()\n\n        ";
+static char __pyx_doc_6mtrand_11RandomState_56standard_cauchy[] = "\n        standard_cauchy(size=None)\n\n        Draw samples from a standard Cauchy distribution with mode = 0.\n\n        Also known as the Lorentz distribution.\n\n        Parameters\n        ----------\n        size : int or tuple of ints, optional\n            Output shape.  If the given shape is, e.g., ``(m, n, k)``, then\n            ``m * n * k`` samples are drawn.  Default is None, in which case a\n            single value is returned.\n\n        Returns\n        -------\n        samples : ndarray or scalar\n            The drawn samples.\n\n        Notes\n        -----\n        The probability density function for the full Cauchy distribution is\n\n        .. math:: P(x; x_0, \\gamma) = \\frac{1}{\\pi \\gamma \\bigl[ 1+\n                  (\\frac{x-x_0}{\\gamma})^2 \\bigr] }\n\n        and the Standard Cauchy distribution just sets :math:`x_0=0` and\n        :math:`\\gamma=1`\n\n        The Cauchy distribution arises in the solution to the driven harmonic\n        oscillator problem, and also describes spectral line broadening. It\n        also describes the distribution of values at which a line tilted at\n        a random angle will cut the x axis.\n\n        When studying hypothesis tests that assume normality, seeing how the\n        tests perform on data from a Cauchy distribution is a good indicator of\n        their sensitivity to a heavy-tailed distribution, since the Cauchy looks\n        very much like a Gaussian distribution, but with heavier tails.\n\n        References\n        ----------\n        .. [1] NIST/SEMATECH e-Handbook of Statistical Methods, \"Cauchy\n              Distribution\",\n              https://www.itl.nist.gov/div898/handbook/eda/section3/eda3663.htm\n        .. [2] Weisstein, Eric W. \"Cauchy Distribution.\" From MathWorld--A\n              Wolfram Web Resource.\n              http://mathworld.wolfram.com/CauchyDistribution.html\n        .. [3] Wikipedia, \"Cauchy distribution\"\n              https://en.wikipedia.org/wiki""/Cauchy_distribution\n\n        Examples\n        --------\n        Draw samples and plot the distribution:\n\n        >>> import matplotlib.pyplot as plt\n        >>> s = np.random.standard_cauchy(1000000)\n        >>> s = s[(s>-25) & (s<25)]  # truncate distribution so it plots well\n        >>> plt.hist(s, bins=100)\n        >>> plt.show()\n\n        ";
 static PyObject *__pyx_pw_6mtrand_11RandomState_57standard_cauchy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyObject *__pyx_v_size = 0;
   PyObject *__pyx_r = 0;
@@ -24561,7 +24624,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_57standard_cauchy(PyObject *__py
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "standard_cauchy") < 0)) __PYX_ERR(0, 2391, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "standard_cauchy") < 0)) __PYX_ERR(0, 2395, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -24575,7 +24638,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_57standard_cauchy(PyObject *__py
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("standard_cauchy", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2391, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("standard_cauchy", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2395, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("mtrand.RandomState.standard_cauchy", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -24595,7 +24658,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_56standard_cauchy(struct __pyx_o
   PyObject *__pyx_t_2 = NULL;
   __Pyx_RefNannySetupContext("standard_cauchy", 0);
 
-  /* "mtrand.pyx":2452
+  /* "mtrand.pyx":2457
  * 
  *         """
  *         return cont0_array(self.internal_state, rk_standard_cauchy, size,             # <<<<<<<<<<<<<<
@@ -24604,7 +24667,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_56standard_cauchy(struct __pyx_o
  */
   __Pyx_XDECREF(__pyx_r);
 
-  /* "mtrand.pyx":2453
+  /* "mtrand.pyx":2458
  *         """
  *         return cont0_array(self.internal_state, rk_standard_cauchy, size,
  *                            self.lock)             # <<<<<<<<<<<<<<
@@ -24614,21 +24677,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_56standard_cauchy(struct __pyx_o
   __pyx_t_1 = __pyx_v_self->lock;
   __Pyx_INCREF(__pyx_t_1);
 
-  /* "mtrand.pyx":2452
+  /* "mtrand.pyx":2457
  * 
  *         """
  *         return cont0_array(self.internal_state, rk_standard_cauchy, size,             # <<<<<<<<<<<<<<
  *                            self.lock)
  * 
  */
-  __pyx_t_2 = __pyx_f_6mtrand_cont0_array(__pyx_v_self->internal_state, rk_standard_cauchy, __pyx_v_size, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2452, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_6mtrand_cont0_array(__pyx_v_self->internal_state, rk_standard_cauchy, __pyx_v_size, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2457, __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;
 
-  /* "mtrand.pyx":2391
+  /* "mtrand.pyx":2395
  *                            odf, ononc, self.lock)
  * 
  *     def standard_cauchy(self, size=None):             # <<<<<<<<<<<<<<
@@ -24648,7 +24711,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_56standard_cauchy(struct __pyx_o
   return __pyx_r;
 }
 
-/* "mtrand.pyx":2455
+/* "mtrand.pyx":2460
  *                            self.lock)
  * 
  *     def standard_t(self, df, size=None):             # <<<<<<<<<<<<<<
@@ -24693,7 +24756,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_59standard_t(PyObject *__pyx_v_s
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "standard_t") < 0)) __PYX_ERR(0, 2455, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "standard_t") < 0)) __PYX_ERR(0, 2460, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -24709,7 +24772,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_59standard_t(PyObject *__pyx_v_s
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("standard_t", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2455, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("standard_t", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2460, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("mtrand.RandomState.standard_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -24738,14 +24801,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_58standard_t(struct __pyx_obj_6m
   PyObject *__pyx_t_9 = NULL;
   __Pyx_RefNannySetupContext("standard_t", 0);
 
-  /* "mtrand.pyx":2546
+  /* "mtrand.pyx":2551
  *         cdef double fdf
  * 
  *         odf = <ndarray> PyArray_FROM_OTF(df, NPY_DOUBLE, NPY_ARRAY_ALIGNED)             # <<<<<<<<<<<<<<
  * 
  *         if odf.shape == ():
  */
-  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_df, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2546, __pyx_L1_error)
+  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_df, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2551, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_2 = __pyx_t_1;
   __Pyx_INCREF(__pyx_t_2);
@@ -24753,32 +24816,32 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_58standard_t(struct __pyx_obj_6m
   __pyx_v_odf = ((PyArrayObject *)__pyx_t_2);
   __pyx_t_2 = 0;
 
-  /* "mtrand.pyx":2548
+  /* "mtrand.pyx":2553
  *         odf = <ndarray> PyArray_FROM_OTF(df, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if odf.shape == ():             # <<<<<<<<<<<<<<
  *             fdf = PyFloat_AsDouble(df)
  * 
  */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_odf), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2548, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_odf), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2553, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2548, __pyx_L1_error)
+  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2553, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2548, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2553, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (__pyx_t_3) {
 
-    /* "mtrand.pyx":2549
+    /* "mtrand.pyx":2554
  * 
  *         if odf.shape == ():
  *             fdf = PyFloat_AsDouble(df)             # <<<<<<<<<<<<<<
  * 
  *             if fdf <= 0:
  */
-    __pyx_t_4 = PyFloat_AsDouble(__pyx_v_df); if (unlikely(__pyx_t_4 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 2549, __pyx_L1_error)
+    __pyx_t_4 = PyFloat_AsDouble(__pyx_v_df); if (unlikely(__pyx_t_4 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 2554, __pyx_L1_error)
     __pyx_v_fdf = __pyx_t_4;
 
-    /* "mtrand.pyx":2551
+    /* "mtrand.pyx":2556
  *             fdf = PyFloat_AsDouble(df)
  * 
  *             if fdf <= 0:             # <<<<<<<<<<<<<<
@@ -24788,20 +24851,20 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_58standard_t(struct __pyx_obj_6m
     __pyx_t_3 = ((__pyx_v_fdf <= 0.0) != 0);
     if (unlikely(__pyx_t_3)) {
 
-      /* "mtrand.pyx":2552
+      /* "mtrand.pyx":2557
  * 
  *             if fdf <= 0:
  *                 raise ValueError("df <= 0")             # <<<<<<<<<<<<<<
  *             return cont1_array_sc(self.internal_state, rk_standard_t, size,
  *                                   fdf, self.lock)
  */
-      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2552, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2557, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_Raise(__pyx_t_1, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __PYX_ERR(0, 2552, __pyx_L1_error)
+      __PYX_ERR(0, 2557, __pyx_L1_error)
 
-      /* "mtrand.pyx":2551
+      /* "mtrand.pyx":2556
  *             fdf = PyFloat_AsDouble(df)
  * 
  *             if fdf <= 0:             # <<<<<<<<<<<<<<
@@ -24810,7 +24873,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_58standard_t(struct __pyx_obj_6m
  */
     }
 
-    /* "mtrand.pyx":2553
+    /* "mtrand.pyx":2558
  *             if fdf <= 0:
  *                 raise ValueError("df <= 0")
  *             return cont1_array_sc(self.internal_state, rk_standard_t, size,             # <<<<<<<<<<<<<<
@@ -24819,7 +24882,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_58standard_t(struct __pyx_obj_6m
  */
     __Pyx_XDECREF(__pyx_r);
 
-    /* "mtrand.pyx":2554
+    /* "mtrand.pyx":2559
  *                 raise ValueError("df <= 0")
  *             return cont1_array_sc(self.internal_state, rk_standard_t, size,
  *                                   fdf, self.lock)             # <<<<<<<<<<<<<<
@@ -24829,21 +24892,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_58standard_t(struct __pyx_obj_6m
     __pyx_t_1 = __pyx_v_self->lock;
     __Pyx_INCREF(__pyx_t_1);
 
-    /* "mtrand.pyx":2553
+    /* "mtrand.pyx":2558
  *             if fdf <= 0:
  *                 raise ValueError("df <= 0")
  *             return cont1_array_sc(self.internal_state, rk_standard_t, size,             # <<<<<<<<<<<<<<
  *                                   fdf, self.lock)
  * 
  */
-    __pyx_t_2 = __pyx_f_6mtrand_cont1_array_sc(__pyx_v_self->internal_state, rk_standard_t, __pyx_v_size, __pyx_v_fdf, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2553, __pyx_L1_error)
+    __pyx_t_2 = __pyx_f_6mtrand_cont1_array_sc(__pyx_v_self->internal_state, rk_standard_t, __pyx_v_size, __pyx_v_fdf, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2558, __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;
 
-    /* "mtrand.pyx":2548
+    /* "mtrand.pyx":2553
  *         odf = <ndarray> PyArray_FROM_OTF(df, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if odf.shape == ():             # <<<<<<<<<<<<<<
@@ -24852,21 +24915,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_58standard_t(struct __pyx_obj_6m
  */
   }
 
-  /* "mtrand.pyx":2556
+  /* "mtrand.pyx":2561
  *                                   fdf, self.lock)
  * 
  *         if np.any(np.less_equal(odf, 0.0)):             # <<<<<<<<<<<<<<
  *             raise ValueError("df <= 0")
  *         return cont1_array(self.internal_state, rk_standard_t, size, odf,
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2556, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2561, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_any); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2556, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_any); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2561, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2556, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2561, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_less_equal); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2556, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_less_equal); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2561, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   __pyx_t_6 = NULL;
@@ -24884,7 +24947,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_58standard_t(struct __pyx_obj_6m
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_7)) {
     PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_v_odf), __pyx_float_0_0};
-    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2556, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2561, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
@@ -24892,13 +24955,13 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_58standard_t(struct __pyx_obj_6m
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
     PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_v_odf), __pyx_float_0_0};
-    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2556, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2561, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
   #endif
   {
-    __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2556, __pyx_L1_error)
+    __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2561, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_9);
     if (__pyx_t_6) {
       __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL;
@@ -24909,7 +24972,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_58standard_t(struct __pyx_obj_6m
     __Pyx_INCREF(__pyx_float_0_0);
     __Pyx_GIVEREF(__pyx_float_0_0);
     PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_float_0_0);
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2556, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2561, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
   }
@@ -24927,27 +24990,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_58standard_t(struct __pyx_obj_6m
   __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1);
   __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2556, __pyx_L1_error)
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2561, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2556, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2561, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (unlikely(__pyx_t_3)) {
 
-    /* "mtrand.pyx":2557
+    /* "mtrand.pyx":2562
  * 
  *         if np.any(np.less_equal(odf, 0.0)):
  *             raise ValueError("df <= 0")             # <<<<<<<<<<<<<<
  *         return cont1_array(self.internal_state, rk_standard_t, size, odf,
  *                            self.lock)
  */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2557, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2562, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __PYX_ERR(0, 2557, __pyx_L1_error)
+    __PYX_ERR(0, 2562, __pyx_L1_error)
 
-    /* "mtrand.pyx":2556
+    /* "mtrand.pyx":2561
  *                                   fdf, self.lock)
  * 
  *         if np.any(np.less_equal(odf, 0.0)):             # <<<<<<<<<<<<<<
@@ -24956,7 +25019,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_58standard_t(struct __pyx_obj_6m
  */
   }
 
-  /* "mtrand.pyx":2558
+  /* "mtrand.pyx":2563
  *         if np.any(np.less_equal(odf, 0.0)):
  *             raise ValueError("df <= 0")
  *         return cont1_array(self.internal_state, rk_standard_t, size, odf,             # <<<<<<<<<<<<<<
@@ -24965,7 +25028,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_58standard_t(struct __pyx_obj_6m
  */
   __Pyx_XDECREF(__pyx_r);
 
-  /* "mtrand.pyx":2559
+  /* "mtrand.pyx":2564
  *             raise ValueError("df <= 0")
  *         return cont1_array(self.internal_state, rk_standard_t, size, odf,
  *                            self.lock)             # <<<<<<<<<<<<<<
@@ -24975,21 +25038,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_58standard_t(struct __pyx_obj_6m
   __pyx_t_2 = __pyx_v_self->lock;
   __Pyx_INCREF(__pyx_t_2);
 
-  /* "mtrand.pyx":2558
+  /* "mtrand.pyx":2563
  *         if np.any(np.less_equal(odf, 0.0)):
  *             raise ValueError("df <= 0")
  *         return cont1_array(self.internal_state, rk_standard_t, size, odf,             # <<<<<<<<<<<<<<
  *                            self.lock)
  * 
  */
-  __pyx_t_5 = __pyx_f_6mtrand_cont1_array(__pyx_v_self->internal_state, rk_standard_t, __pyx_v_size, __pyx_v_odf, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2558, __pyx_L1_error)
+  __pyx_t_5 = __pyx_f_6mtrand_cont1_array(__pyx_v_self->internal_state, rk_standard_t, __pyx_v_size, __pyx_v_odf, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2563, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_r = __pyx_t_5;
   __pyx_t_5 = 0;
   goto __pyx_L0;
 
-  /* "mtrand.pyx":2455
+  /* "mtrand.pyx":2460
  *                            self.lock)
  * 
  *     def standard_t(self, df, size=None):             # <<<<<<<<<<<<<<
@@ -25014,7 +25077,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_58standard_t(struct __pyx_obj_6m
   return __pyx_r;
 }
 
-/* "mtrand.pyx":2561
+/* "mtrand.pyx":2566
  *                            self.lock)
  * 
  *     def vonmises(self, mu, kappa, size=None):             # <<<<<<<<<<<<<<
@@ -25058,7 +25121,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_61vonmises(PyObject *__pyx_v_sel
         case  1:
         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kappa)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("vonmises", 0, 2, 3, 1); __PYX_ERR(0, 2561, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("vonmises", 0, 2, 3, 1); __PYX_ERR(0, 2566, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  2:
@@ -25068,7 +25131,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_61vonmises(PyObject *__pyx_v_sel
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "vonmises") < 0)) __PYX_ERR(0, 2561, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "vonmises") < 0)) __PYX_ERR(0, 2566, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -25086,7 +25149,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_61vonmises(PyObject *__pyx_v_sel
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("vonmises", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2561, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("vonmises", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2566, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("mtrand.RandomState.vonmises", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -25117,14 +25180,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_60vonmises(struct __pyx_obj_6mtr
   PyObject *__pyx_t_9 = NULL;
   __Pyx_RefNannySetupContext("vonmises", 0);
 
-  /* "mtrand.pyx":2642
+  /* "mtrand.pyx":2647
  *         cdef double fmu, fkappa
  * 
  *         omu = <ndarray> PyArray_FROM_OTF(mu, NPY_DOUBLE, NPY_ARRAY_ALIGNED)             # <<<<<<<<<<<<<<
  *         okappa = <ndarray> PyArray_FROM_OTF(kappa, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  */
-  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_mu, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2642, __pyx_L1_error)
+  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_mu, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2647, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_2 = __pyx_t_1;
   __Pyx_INCREF(__pyx_t_2);
@@ -25132,14 +25195,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_60vonmises(struct __pyx_obj_6mtr
   __pyx_v_omu = ((PyArrayObject *)__pyx_t_2);
   __pyx_t_2 = 0;
 
-  /* "mtrand.pyx":2643
+  /* "mtrand.pyx":2648
  * 
  *         omu = <ndarray> PyArray_FROM_OTF(mu, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  *         okappa = <ndarray> PyArray_FROM_OTF(kappa, NPY_DOUBLE, NPY_ARRAY_ALIGNED)             # <<<<<<<<<<<<<<
  * 
  *         if omu.shape == okappa.shape == ():
  */
-  __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_kappa, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2643, __pyx_L1_error)
+  __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_kappa, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2648, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_1 = __pyx_t_2;
   __Pyx_INCREF(__pyx_t_1);
@@ -25147,49 +25210,49 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_60vonmises(struct __pyx_obj_6mtr
   __pyx_v_okappa = ((PyArrayObject *)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "mtrand.pyx":2645
+  /* "mtrand.pyx":2650
  *         okappa = <ndarray> PyArray_FROM_OTF(kappa, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if omu.shape == okappa.shape == ():             # <<<<<<<<<<<<<<
  *             fmu = PyFloat_AsDouble(mu)
  *             fkappa = PyFloat_AsDouble(kappa)
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_omu), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2645, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_omu), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2650, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_okappa), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2645, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_okappa), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2650, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2645, __pyx_L1_error)
+  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2650, __pyx_L1_error)
   if (__Pyx_PyObject_IsTrue(__pyx_t_3)) {
     __Pyx_DECREF(__pyx_t_3);
-    __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2645, __pyx_L1_error)
+    __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2650, __pyx_L1_error)
   }
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2645, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2650, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   if (__pyx_t_4) {
 
-    /* "mtrand.pyx":2646
+    /* "mtrand.pyx":2651
  * 
  *         if omu.shape == okappa.shape == ():
  *             fmu = PyFloat_AsDouble(mu)             # <<<<<<<<<<<<<<
  *             fkappa = PyFloat_AsDouble(kappa)
  * 
  */
-    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_mu); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 2646, __pyx_L1_error)
+    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_mu); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 2651, __pyx_L1_error)
     __pyx_v_fmu = __pyx_t_5;
 
-    /* "mtrand.pyx":2647
+    /* "mtrand.pyx":2652
  *         if omu.shape == okappa.shape == ():
  *             fmu = PyFloat_AsDouble(mu)
  *             fkappa = PyFloat_AsDouble(kappa)             # <<<<<<<<<<<<<<
  * 
  *             if fkappa < 0:
  */
-    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_kappa); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 2647, __pyx_L1_error)
+    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_kappa); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 2652, __pyx_L1_error)
     __pyx_v_fkappa = __pyx_t_5;
 
-    /* "mtrand.pyx":2649
+    /* "mtrand.pyx":2654
  *             fkappa = PyFloat_AsDouble(kappa)
  * 
  *             if fkappa < 0:             # <<<<<<<<<<<<<<
@@ -25199,20 +25262,20 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_60vonmises(struct __pyx_obj_6mtr
     __pyx_t_4 = ((__pyx_v_fkappa < 0.0) != 0);
     if (unlikely(__pyx_t_4)) {
 
-      /* "mtrand.pyx":2650
+      /* "mtrand.pyx":2655
  * 
  *             if fkappa < 0:
  *                 raise ValueError("kappa < 0")             # <<<<<<<<<<<<<<
  *             return cont2_array_sc(self.internal_state, rk_vonmises, size, fmu,
  *                                   fkappa, self.lock)
  */
-      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2650, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2655, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __PYX_ERR(0, 2650, __pyx_L1_error)
+      __PYX_ERR(0, 2655, __pyx_L1_error)
 
-      /* "mtrand.pyx":2649
+      /* "mtrand.pyx":2654
  *             fkappa = PyFloat_AsDouble(kappa)
  * 
  *             if fkappa < 0:             # <<<<<<<<<<<<<<
@@ -25221,7 +25284,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_60vonmises(struct __pyx_obj_6mtr
  */
     }
 
-    /* "mtrand.pyx":2651
+    /* "mtrand.pyx":2656
  *             if fkappa < 0:
  *                 raise ValueError("kappa < 0")
  *             return cont2_array_sc(self.internal_state, rk_vonmises, size, fmu,             # <<<<<<<<<<<<<<
@@ -25230,7 +25293,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_60vonmises(struct __pyx_obj_6mtr
  */
     __Pyx_XDECREF(__pyx_r);
 
-    /* "mtrand.pyx":2652
+    /* "mtrand.pyx":2657
  *                 raise ValueError("kappa < 0")
  *             return cont2_array_sc(self.internal_state, rk_vonmises, size, fmu,
  *                                   fkappa, self.lock)             # <<<<<<<<<<<<<<
@@ -25240,21 +25303,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_60vonmises(struct __pyx_obj_6mtr
     __pyx_t_3 = __pyx_v_self->lock;
     __Pyx_INCREF(__pyx_t_3);
 
-    /* "mtrand.pyx":2651
+    /* "mtrand.pyx":2656
  *             if fkappa < 0:
  *                 raise ValueError("kappa < 0")
  *             return cont2_array_sc(self.internal_state, rk_vonmises, size, fmu,             # <<<<<<<<<<<<<<
  *                                   fkappa, self.lock)
  * 
  */
-    __pyx_t_2 = __pyx_f_6mtrand_cont2_array_sc(__pyx_v_self->internal_state, rk_vonmises, __pyx_v_size, __pyx_v_fmu, __pyx_v_fkappa, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2651, __pyx_L1_error)
+    __pyx_t_2 = __pyx_f_6mtrand_cont2_array_sc(__pyx_v_self->internal_state, rk_vonmises, __pyx_v_size, __pyx_v_fmu, __pyx_v_fkappa, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2656, __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;
 
-    /* "mtrand.pyx":2645
+    /* "mtrand.pyx":2650
  *         okappa = <ndarray> PyArray_FROM_OTF(kappa, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if omu.shape == okappa.shape == ():             # <<<<<<<<<<<<<<
@@ -25263,21 +25326,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_60vonmises(struct __pyx_obj_6mtr
  */
   }
 
-  /* "mtrand.pyx":2654
+  /* "mtrand.pyx":2659
  *                                   fkappa, self.lock)
  * 
  *         if np.any(np.less(okappa, 0.0)):             # <<<<<<<<<<<<<<
  *             raise ValueError("kappa < 0")
  *         return cont2_array(self.internal_state, rk_vonmises, size, omu, okappa,
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2654, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2659, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_any); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2654, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_any); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2659, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2654, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2659, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_less); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2654, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_less); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2659, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   __pyx_t_6 = NULL;
@@ -25295,7 +25358,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_60vonmises(struct __pyx_obj_6mtr
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_7)) {
     PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_v_okappa), __pyx_float_0_0};
-    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2654, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2659, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_GOTREF(__pyx_t_3);
   } else
@@ -25303,13 +25366,13 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_60vonmises(struct __pyx_obj_6mtr
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
     PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_v_okappa), __pyx_float_0_0};
-    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2654, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2659, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_GOTREF(__pyx_t_3);
   } else
   #endif
   {
-    __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2654, __pyx_L1_error)
+    __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2659, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_9);
     if (__pyx_t_6) {
       __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL;
@@ -25320,7 +25383,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_60vonmises(struct __pyx_obj_6mtr
     __Pyx_INCREF(__pyx_float_0_0);
     __Pyx_GIVEREF(__pyx_float_0_0);
     PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_float_0_0);
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2654, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2659, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
   }
@@ -25338,27 +25401,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_60vonmises(struct __pyx_obj_6mtr
   __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_7, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3);
   __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2654, __pyx_L1_error)
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2659, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2654, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2659, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (unlikely(__pyx_t_4)) {
 
-    /* "mtrand.pyx":2655
+    /* "mtrand.pyx":2660
  * 
  *         if np.any(np.less(okappa, 0.0)):
  *             raise ValueError("kappa < 0")             # <<<<<<<<<<<<<<
  *         return cont2_array(self.internal_state, rk_vonmises, size, omu, okappa,
  *                            self.lock)
  */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2655, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2660, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __PYX_ERR(0, 2655, __pyx_L1_error)
+    __PYX_ERR(0, 2660, __pyx_L1_error)
 
-    /* "mtrand.pyx":2654
+    /* "mtrand.pyx":2659
  *                                   fkappa, self.lock)
  * 
  *         if np.any(np.less(okappa, 0.0)):             # <<<<<<<<<<<<<<
@@ -25367,7 +25430,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_60vonmises(struct __pyx_obj_6mtr
  */
   }
 
-  /* "mtrand.pyx":2656
+  /* "mtrand.pyx":2661
  *         if np.any(np.less(okappa, 0.0)):
  *             raise ValueError("kappa < 0")
  *         return cont2_array(self.internal_state, rk_vonmises, size, omu, okappa,             # <<<<<<<<<<<<<<
@@ -25376,7 +25439,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_60vonmises(struct __pyx_obj_6mtr
  */
   __Pyx_XDECREF(__pyx_r);
 
-  /* "mtrand.pyx":2657
+  /* "mtrand.pyx":2662
  *             raise ValueError("kappa < 0")
  *         return cont2_array(self.internal_state, rk_vonmises, size, omu, okappa,
  *                            self.lock)             # <<<<<<<<<<<<<<
@@ -25386,21 +25449,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_60vonmises(struct __pyx_obj_6mtr
   __pyx_t_2 = __pyx_v_self->lock;
   __Pyx_INCREF(__pyx_t_2);
 
-  /* "mtrand.pyx":2656
+  /* "mtrand.pyx":2661
  *         if np.any(np.less(okappa, 0.0)):
  *             raise ValueError("kappa < 0")
  *         return cont2_array(self.internal_state, rk_vonmises, size, omu, okappa,             # <<<<<<<<<<<<<<
  *                            self.lock)
  * 
  */
-  __pyx_t_1 = __pyx_f_6mtrand_cont2_array(__pyx_v_self->internal_state, rk_vonmises, __pyx_v_size, __pyx_v_omu, __pyx_v_okappa, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2656, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_6mtrand_cont2_array(__pyx_v_self->internal_state, rk_vonmises, __pyx_v_size, __pyx_v_omu, __pyx_v_okappa, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2661, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "mtrand.pyx":2561
+  /* "mtrand.pyx":2566
  *                            self.lock)
  * 
  *     def vonmises(self, mu, kappa, size=None):             # <<<<<<<<<<<<<<
@@ -25426,7 +25489,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_60vonmises(struct __pyx_obj_6mtr
   return __pyx_r;
 }
 
-/* "mtrand.pyx":2659
+/* "mtrand.pyx":2664
  *                            self.lock)
  * 
  *     def pareto(self, a, size=None):             # <<<<<<<<<<<<<<
@@ -25471,7 +25534,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_63pareto(PyObject *__pyx_v_self,
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pareto") < 0)) __PYX_ERR(0, 2659, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pareto") < 0)) __PYX_ERR(0, 2664, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -25487,7 +25550,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_63pareto(PyObject *__pyx_v_self,
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("pareto", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2659, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("pareto", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2664, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("mtrand.RandomState.pareto", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -25516,14 +25579,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_62pareto(struct __pyx_obj_6mtran
   PyObject *__pyx_t_9 = NULL;
   __Pyx_RefNannySetupContext("pareto", 0);
 
-  /* "mtrand.pyx":2755
+  /* "mtrand.pyx":2760
  *         cdef double fa
  * 
  *         oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ARRAY_ALIGNED)             # <<<<<<<<<<<<<<
  * 
  *         if oa.shape == ():
  */
-  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_a, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2755, __pyx_L1_error)
+  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_a, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2760, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_2 = __pyx_t_1;
   __Pyx_INCREF(__pyx_t_2);
@@ -25531,32 +25594,32 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_62pareto(struct __pyx_obj_6mtran
   __pyx_v_oa = ((PyArrayObject *)__pyx_t_2);
   __pyx_t_2 = 0;
 
-  /* "mtrand.pyx":2757
+  /* "mtrand.pyx":2762
  *         oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if oa.shape == ():             # <<<<<<<<<<<<<<
  *             fa = PyFloat_AsDouble(a)
  * 
  */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_oa), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2757, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_oa), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2762, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2757, __pyx_L1_error)
+  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2762, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2757, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2762, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (__pyx_t_3) {
 
-    /* "mtrand.pyx":2758
+    /* "mtrand.pyx":2763
  * 
  *         if oa.shape == ():
  *             fa = PyFloat_AsDouble(a)             # <<<<<<<<<<<<<<
  * 
  *             if fa <= 0:
  */
-    __pyx_t_4 = PyFloat_AsDouble(__pyx_v_a); if (unlikely(__pyx_t_4 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 2758, __pyx_L1_error)
+    __pyx_t_4 = PyFloat_AsDouble(__pyx_v_a); if (unlikely(__pyx_t_4 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 2763, __pyx_L1_error)
     __pyx_v_fa = __pyx_t_4;
 
-    /* "mtrand.pyx":2760
+    /* "mtrand.pyx":2765
  *             fa = PyFloat_AsDouble(a)
  * 
  *             if fa <= 0:             # <<<<<<<<<<<<<<
@@ -25566,20 +25629,20 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_62pareto(struct __pyx_obj_6mtran
     __pyx_t_3 = ((__pyx_v_fa <= 0.0) != 0);
     if (unlikely(__pyx_t_3)) {
 
-      /* "mtrand.pyx":2761
+      /* "mtrand.pyx":2766
  * 
  *             if fa <= 0:
  *                 raise ValueError("a <= 0")             # <<<<<<<<<<<<<<
  *             return cont1_array_sc(self.internal_state, rk_pareto, size, fa,
  *                                   self.lock)
  */
-      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2761, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2766, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_Raise(__pyx_t_1, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __PYX_ERR(0, 2761, __pyx_L1_error)
+      __PYX_ERR(0, 2766, __pyx_L1_error)
 
-      /* "mtrand.pyx":2760
+      /* "mtrand.pyx":2765
  *             fa = PyFloat_AsDouble(a)
  * 
  *             if fa <= 0:             # <<<<<<<<<<<<<<
@@ -25588,7 +25651,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_62pareto(struct __pyx_obj_6mtran
  */
     }
 
-    /* "mtrand.pyx":2762
+    /* "mtrand.pyx":2767
  *             if fa <= 0:
  *                 raise ValueError("a <= 0")
  *             return cont1_array_sc(self.internal_state, rk_pareto, size, fa,             # <<<<<<<<<<<<<<
@@ -25597,7 +25660,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_62pareto(struct __pyx_obj_6mtran
  */
     __Pyx_XDECREF(__pyx_r);
 
-    /* "mtrand.pyx":2763
+    /* "mtrand.pyx":2768
  *                 raise ValueError("a <= 0")
  *             return cont1_array_sc(self.internal_state, rk_pareto, size, fa,
  *                                   self.lock)             # <<<<<<<<<<<<<<
@@ -25607,21 +25670,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_62pareto(struct __pyx_obj_6mtran
     __pyx_t_1 = __pyx_v_self->lock;
     __Pyx_INCREF(__pyx_t_1);
 
-    /* "mtrand.pyx":2762
+    /* "mtrand.pyx":2767
  *             if fa <= 0:
  *                 raise ValueError("a <= 0")
  *             return cont1_array_sc(self.internal_state, rk_pareto, size, fa,             # <<<<<<<<<<<<<<
  *                                   self.lock)
  * 
  */
-    __pyx_t_2 = __pyx_f_6mtrand_cont1_array_sc(__pyx_v_self->internal_state, rk_pareto, __pyx_v_size, __pyx_v_fa, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2762, __pyx_L1_error)
+    __pyx_t_2 = __pyx_f_6mtrand_cont1_array_sc(__pyx_v_self->internal_state, rk_pareto, __pyx_v_size, __pyx_v_fa, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2767, __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;
 
-    /* "mtrand.pyx":2757
+    /* "mtrand.pyx":2762
  *         oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if oa.shape == ():             # <<<<<<<<<<<<<<
@@ -25630,21 +25693,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_62pareto(struct __pyx_obj_6mtran
  */
   }
 
-  /* "mtrand.pyx":2765
+  /* "mtrand.pyx":2770
  *                                   self.lock)
  * 
  *         if np.any(np.less_equal(oa, 0.0)):             # <<<<<<<<<<<<<<
  *             raise ValueError("a <= 0")
  *         return cont1_array(self.internal_state, rk_pareto, size, oa, self.lock)
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2765, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2770, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_any); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2765, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_any); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2770, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2765, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2770, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_less_equal); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2765, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_less_equal); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2770, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   __pyx_t_6 = NULL;
@@ -25662,7 +25725,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_62pareto(struct __pyx_obj_6mtran
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_7)) {
     PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_v_oa), __pyx_float_0_0};
-    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2765, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2770, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
@@ -25670,13 +25733,13 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_62pareto(struct __pyx_obj_6mtran
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
     PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_v_oa), __pyx_float_0_0};
-    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2765, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2770, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
   #endif
   {
-    __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2765, __pyx_L1_error)
+    __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2770, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_9);
     if (__pyx_t_6) {
       __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL;
@@ -25687,7 +25750,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_62pareto(struct __pyx_obj_6mtran
     __Pyx_INCREF(__pyx_float_0_0);
     __Pyx_GIVEREF(__pyx_float_0_0);
     PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_float_0_0);
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2765, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2770, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
   }
@@ -25705,27 +25768,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_62pareto(struct __pyx_obj_6mtran
   __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1);
   __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2765, __pyx_L1_error)
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2770, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2765, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2770, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (unlikely(__pyx_t_3)) {
 
-    /* "mtrand.pyx":2766
+    /* "mtrand.pyx":2771
  * 
  *         if np.any(np.less_equal(oa, 0.0)):
  *             raise ValueError("a <= 0")             # <<<<<<<<<<<<<<
  *         return cont1_array(self.internal_state, rk_pareto, size, oa, self.lock)
  * 
  */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2766, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2771, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __PYX_ERR(0, 2766, __pyx_L1_error)
+    __PYX_ERR(0, 2771, __pyx_L1_error)
 
-    /* "mtrand.pyx":2765
+    /* "mtrand.pyx":2770
  *                                   self.lock)
  * 
  *         if np.any(np.less_equal(oa, 0.0)):             # <<<<<<<<<<<<<<
@@ -25734,7 +25797,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_62pareto(struct __pyx_obj_6mtran
  */
   }
 
-  /* "mtrand.pyx":2767
+  /* "mtrand.pyx":2772
  *         if np.any(np.less_equal(oa, 0.0)):
  *             raise ValueError("a <= 0")
  *         return cont1_array(self.internal_state, rk_pareto, size, oa, self.lock)             # <<<<<<<<<<<<<<
@@ -25744,14 +25807,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_62pareto(struct __pyx_obj_6mtran
   __Pyx_XDECREF(__pyx_r);
   __pyx_t_2 = __pyx_v_self->lock;
   __Pyx_INCREF(__pyx_t_2);
-  __pyx_t_5 = __pyx_f_6mtrand_cont1_array(__pyx_v_self->internal_state, rk_pareto, __pyx_v_size, __pyx_v_oa, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2767, __pyx_L1_error)
+  __pyx_t_5 = __pyx_f_6mtrand_cont1_array(__pyx_v_self->internal_state, rk_pareto, __pyx_v_size, __pyx_v_oa, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2772, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_r = __pyx_t_5;
   __pyx_t_5 = 0;
   goto __pyx_L0;
 
-  /* "mtrand.pyx":2659
+  /* "mtrand.pyx":2664
  *                            self.lock)
  * 
  *     def pareto(self, a, size=None):             # <<<<<<<<<<<<<<
@@ -25776,7 +25839,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_62pareto(struct __pyx_obj_6mtran
   return __pyx_r;
 }
 
-/* "mtrand.pyx":2769
+/* "mtrand.pyx":2774
  *         return cont1_array(self.internal_state, rk_pareto, size, oa, self.lock)
  * 
  *     def weibull(self, a, size=None):             # <<<<<<<<<<<<<<
@@ -25821,7 +25884,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_65weibull(PyObject *__pyx_v_self
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "weibull") < 0)) __PYX_ERR(0, 2769, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "weibull") < 0)) __PYX_ERR(0, 2774, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -25837,7 +25900,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_65weibull(PyObject *__pyx_v_self
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("weibull", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2769, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("weibull", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2774, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("mtrand.RandomState.weibull", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -25864,14 +25927,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_64weibull(struct __pyx_obj_6mtra
   PyObject *__pyx_t_7 = NULL;
   __Pyx_RefNannySetupContext("weibull", 0);
 
-  /* "mtrand.pyx":2865
+  /* "mtrand.pyx":2870
  *         cdef double fa
  * 
  *         oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ARRAY_ALIGNED)             # <<<<<<<<<<<<<<
  * 
  *         if oa.shape == ():
  */
-  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_a, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2865, __pyx_L1_error)
+  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_a, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2870, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_2 = __pyx_t_1;
   __Pyx_INCREF(__pyx_t_2);
@@ -25879,44 +25942,44 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_64weibull(struct __pyx_obj_6mtra
   __pyx_v_oa = ((PyArrayObject *)__pyx_t_2);
   __pyx_t_2 = 0;
 
-  /* "mtrand.pyx":2867
+  /* "mtrand.pyx":2872
  *         oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if oa.shape == ():             # <<<<<<<<<<<<<<
  *             fa = PyFloat_AsDouble(a)
  *             if np.signbit(fa):
  */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_oa), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2867, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_oa), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2872, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2867, __pyx_L1_error)
+  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2872, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2867, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2872, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (__pyx_t_3) {
 
-    /* "mtrand.pyx":2868
+    /* "mtrand.pyx":2873
  * 
  *         if oa.shape == ():
  *             fa = PyFloat_AsDouble(a)             # <<<<<<<<<<<<<<
  *             if np.signbit(fa):
  *                 raise ValueError("a < 0")
  */
-    __pyx_t_4 = PyFloat_AsDouble(__pyx_v_a); if (unlikely(__pyx_t_4 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 2868, __pyx_L1_error)
+    __pyx_t_4 = PyFloat_AsDouble(__pyx_v_a); if (unlikely(__pyx_t_4 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 2873, __pyx_L1_error)
     __pyx_v_fa = __pyx_t_4;
 
-    /* "mtrand.pyx":2869
+    /* "mtrand.pyx":2874
  *         if oa.shape == ():
  *             fa = PyFloat_AsDouble(a)
  *             if np.signbit(fa):             # <<<<<<<<<<<<<<
  *                 raise ValueError("a < 0")
  *             return cont1_array_sc(self.internal_state, rk_weibull, size, fa,
  */
-    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2869, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2874, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_signbit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2869, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_signbit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2874, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_fa); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2869, __pyx_L1_error)
+    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_fa); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2874, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_t_6 = NULL;
     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
@@ -25931,27 +25994,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_64weibull(struct __pyx_obj_6mtra
     __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2);
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2869, __pyx_L1_error)
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2874, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2869, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2874, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     if (unlikely(__pyx_t_3)) {
 
-      /* "mtrand.pyx":2870
+      /* "mtrand.pyx":2875
  *             fa = PyFloat_AsDouble(a)
  *             if np.signbit(fa):
  *                 raise ValueError("a < 0")             # <<<<<<<<<<<<<<
  *             return cont1_array_sc(self.internal_state, rk_weibull, size, fa,
  *                                   self.lock)
  */
-      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2870, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2875, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_Raise(__pyx_t_1, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __PYX_ERR(0, 2870, __pyx_L1_error)
+      __PYX_ERR(0, 2875, __pyx_L1_error)
 
-      /* "mtrand.pyx":2869
+      /* "mtrand.pyx":2874
  *         if oa.shape == ():
  *             fa = PyFloat_AsDouble(a)
  *             if np.signbit(fa):             # <<<<<<<<<<<<<<
@@ -25960,7 +26023,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_64weibull(struct __pyx_obj_6mtra
  */
     }
 
-    /* "mtrand.pyx":2871
+    /* "mtrand.pyx":2876
  *             if np.signbit(fa):
  *                 raise ValueError("a < 0")
  *             return cont1_array_sc(self.internal_state, rk_weibull, size, fa,             # <<<<<<<<<<<<<<
@@ -25969,7 +26032,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_64weibull(struct __pyx_obj_6mtra
  */
     __Pyx_XDECREF(__pyx_r);
 
-    /* "mtrand.pyx":2872
+    /* "mtrand.pyx":2877
  *                 raise ValueError("a < 0")
  *             return cont1_array_sc(self.internal_state, rk_weibull, size, fa,
  *                                   self.lock)             # <<<<<<<<<<<<<<
@@ -25979,21 +26042,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_64weibull(struct __pyx_obj_6mtra
     __pyx_t_1 = __pyx_v_self->lock;
     __Pyx_INCREF(__pyx_t_1);
 
-    /* "mtrand.pyx":2871
+    /* "mtrand.pyx":2876
  *             if np.signbit(fa):
  *                 raise ValueError("a < 0")
  *             return cont1_array_sc(self.internal_state, rk_weibull, size, fa,             # <<<<<<<<<<<<<<
  *                                   self.lock)
  * 
  */
-    __pyx_t_5 = __pyx_f_6mtrand_cont1_array_sc(__pyx_v_self->internal_state, rk_weibull, __pyx_v_size, __pyx_v_fa, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2871, __pyx_L1_error)
+    __pyx_t_5 = __pyx_f_6mtrand_cont1_array_sc(__pyx_v_self->internal_state, rk_weibull, __pyx_v_size, __pyx_v_fa, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2876, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __pyx_r = __pyx_t_5;
     __pyx_t_5 = 0;
     goto __pyx_L0;
 
-    /* "mtrand.pyx":2867
+    /* "mtrand.pyx":2872
  *         oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if oa.shape == ():             # <<<<<<<<<<<<<<
@@ -26002,21 +26065,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_64weibull(struct __pyx_obj_6mtra
  */
   }
 
-  /* "mtrand.pyx":2874
+  /* "mtrand.pyx":2879
  *                                   self.lock)
  * 
  *         if np.any(np.signbit(oa)):             # <<<<<<<<<<<<<<
  *             raise ValueError("a < 0")
  *         return cont1_array(self.internal_state, rk_weibull, size, oa,
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2874, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2879, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_any); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2874, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_any); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2879, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2874, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2879, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_signbit); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2874, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_signbit); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2879, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   __pyx_t_6 = NULL;
@@ -26031,7 +26094,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_64weibull(struct __pyx_obj_6mtra
   }
   __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_6, ((PyObject *)__pyx_v_oa)) : __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_v_oa));
   __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2874, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2879, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   __pyx_t_7 = NULL;
@@ -26047,27 +26110,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_64weibull(struct __pyx_obj_6mtra
   __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1);
   __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2874, __pyx_L1_error)
+  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2879, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2874, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2879, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   if (unlikely(__pyx_t_3)) {
 
-    /* "mtrand.pyx":2875
+    /* "mtrand.pyx":2880
  * 
  *         if np.any(np.signbit(oa)):
  *             raise ValueError("a < 0")             # <<<<<<<<<<<<<<
  *         return cont1_array(self.internal_state, rk_weibull, size, oa,
  *                            self.lock)
  */
-    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2875, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2880, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_Raise(__pyx_t_5, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __PYX_ERR(0, 2875, __pyx_L1_error)
+    __PYX_ERR(0, 2880, __pyx_L1_error)
 
-    /* "mtrand.pyx":2874
+    /* "mtrand.pyx":2879
  *                                   self.lock)
  * 
  *         if np.any(np.signbit(oa)):             # <<<<<<<<<<<<<<
@@ -26076,7 +26139,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_64weibull(struct __pyx_obj_6mtra
  */
   }
 
-  /* "mtrand.pyx":2876
+  /* "mtrand.pyx":2881
  *         if np.any(np.signbit(oa)):
  *             raise ValueError("a < 0")
  *         return cont1_array(self.internal_state, rk_weibull, size, oa,             # <<<<<<<<<<<<<<
@@ -26085,7 +26148,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_64weibull(struct __pyx_obj_6mtra
  */
   __Pyx_XDECREF(__pyx_r);
 
-  /* "mtrand.pyx":2877
+  /* "mtrand.pyx":2882
  *             raise ValueError("a < 0")
  *         return cont1_array(self.internal_state, rk_weibull, size, oa,
  *                            self.lock)             # <<<<<<<<<<<<<<
@@ -26095,21 +26158,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_64weibull(struct __pyx_obj_6mtra
   __pyx_t_5 = __pyx_v_self->lock;
   __Pyx_INCREF(__pyx_t_5);
 
-  /* "mtrand.pyx":2876
+  /* "mtrand.pyx":2881
  *         if np.any(np.signbit(oa)):
  *             raise ValueError("a < 0")
  *         return cont1_array(self.internal_state, rk_weibull, size, oa,             # <<<<<<<<<<<<<<
  *                            self.lock)
  * 
  */
-  __pyx_t_2 = __pyx_f_6mtrand_cont1_array(__pyx_v_self->internal_state, rk_weibull, __pyx_v_size, __pyx_v_oa, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2876, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_6mtrand_cont1_array(__pyx_v_self->internal_state, rk_weibull, __pyx_v_size, __pyx_v_oa, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2881, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   __pyx_r = __pyx_t_2;
   __pyx_t_2 = 0;
   goto __pyx_L0;
 
-  /* "mtrand.pyx":2769
+  /* "mtrand.pyx":2774
  *         return cont1_array(self.internal_state, rk_pareto, size, oa, self.lock)
  * 
  *     def weibull(self, a, size=None):             # <<<<<<<<<<<<<<
@@ -26133,7 +26196,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_64weibull(struct __pyx_obj_6mtra
   return __pyx_r;
 }
 
-/* "mtrand.pyx":2879
+/* "mtrand.pyx":2884
  *                            self.lock)
  * 
  *     def power(self, a, size=None):             # <<<<<<<<<<<<<<
@@ -26178,7 +26241,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_67power(PyObject *__pyx_v_self,
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "power") < 0)) __PYX_ERR(0, 2879, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "power") < 0)) __PYX_ERR(0, 2884, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -26194,7 +26257,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_67power(PyObject *__pyx_v_self,
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("power", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2879, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("power", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2884, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("mtrand.RandomState.power", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -26221,14 +26284,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_66power(struct __pyx_obj_6mtrand
   PyObject *__pyx_t_7 = NULL;
   __Pyx_RefNannySetupContext("power", 0);
 
-  /* "mtrand.pyx":2977
+  /* "mtrand.pyx":2982
  *         cdef double fa
  * 
  *         oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ARRAY_ALIGNED)             # <<<<<<<<<<<<<<
  * 
  *         if oa.shape == ():
  */
-  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_a, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2977, __pyx_L1_error)
+  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_a, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2982, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_2 = __pyx_t_1;
   __Pyx_INCREF(__pyx_t_2);
@@ -26236,44 +26299,44 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_66power(struct __pyx_obj_6mtrand
   __pyx_v_oa = ((PyArrayObject *)__pyx_t_2);
   __pyx_t_2 = 0;
 
-  /* "mtrand.pyx":2979
+  /* "mtrand.pyx":2984
  *         oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if oa.shape == ():             # <<<<<<<<<<<<<<
  *             fa = PyFloat_AsDouble(a)
  *             if np.signbit(fa):
  */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_oa), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2979, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_oa), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2984, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2979, __pyx_L1_error)
+  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2984, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2979, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2984, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (__pyx_t_3) {
 
-    /* "mtrand.pyx":2980
+    /* "mtrand.pyx":2985
  * 
  *         if oa.shape == ():
  *             fa = PyFloat_AsDouble(a)             # <<<<<<<<<<<<<<
  *             if np.signbit(fa):
  *                 raise ValueError("a < 0")
  */
-    __pyx_t_4 = PyFloat_AsDouble(__pyx_v_a); if (unlikely(__pyx_t_4 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 2980, __pyx_L1_error)
+    __pyx_t_4 = PyFloat_AsDouble(__pyx_v_a); if (unlikely(__pyx_t_4 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 2985, __pyx_L1_error)
     __pyx_v_fa = __pyx_t_4;
 
-    /* "mtrand.pyx":2981
+    /* "mtrand.pyx":2986
  *         if oa.shape == ():
  *             fa = PyFloat_AsDouble(a)
  *             if np.signbit(fa):             # <<<<<<<<<<<<<<
  *                 raise ValueError("a < 0")
  *             return cont1_array_sc(self.internal_state, rk_power, size, fa,
  */
-    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2981, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2986, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_signbit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2981, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_signbit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2986, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_fa); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2981, __pyx_L1_error)
+    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_fa); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2986, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_t_6 = NULL;
     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
@@ -26288,27 +26351,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_66power(struct __pyx_obj_6mtrand
     __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2);
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2981, __pyx_L1_error)
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2986, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2981, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2986, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     if (unlikely(__pyx_t_3)) {
 
-      /* "mtrand.pyx":2982
+      /* "mtrand.pyx":2987
  *             fa = PyFloat_AsDouble(a)
  *             if np.signbit(fa):
  *                 raise ValueError("a < 0")             # <<<<<<<<<<<<<<
  *             return cont1_array_sc(self.internal_state, rk_power, size, fa,
  *                                   self.lock)
  */
-      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2982, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2987, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_Raise(__pyx_t_1, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __PYX_ERR(0, 2982, __pyx_L1_error)
+      __PYX_ERR(0, 2987, __pyx_L1_error)
 
-      /* "mtrand.pyx":2981
+      /* "mtrand.pyx":2986
  *         if oa.shape == ():
  *             fa = PyFloat_AsDouble(a)
  *             if np.signbit(fa):             # <<<<<<<<<<<<<<
@@ -26317,7 +26380,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_66power(struct __pyx_obj_6mtrand
  */
     }
 
-    /* "mtrand.pyx":2983
+    /* "mtrand.pyx":2988
  *             if np.signbit(fa):
  *                 raise ValueError("a < 0")
  *             return cont1_array_sc(self.internal_state, rk_power, size, fa,             # <<<<<<<<<<<<<<
@@ -26326,7 +26389,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_66power(struct __pyx_obj_6mtrand
  */
     __Pyx_XDECREF(__pyx_r);
 
-    /* "mtrand.pyx":2984
+    /* "mtrand.pyx":2989
  *                 raise ValueError("a < 0")
  *             return cont1_array_sc(self.internal_state, rk_power, size, fa,
  *                                   self.lock)             # <<<<<<<<<<<<<<
@@ -26336,21 +26399,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_66power(struct __pyx_obj_6mtrand
     __pyx_t_1 = __pyx_v_self->lock;
     __Pyx_INCREF(__pyx_t_1);
 
-    /* "mtrand.pyx":2983
+    /* "mtrand.pyx":2988
  *             if np.signbit(fa):
  *                 raise ValueError("a < 0")
  *             return cont1_array_sc(self.internal_state, rk_power, size, fa,             # <<<<<<<<<<<<<<
  *                                   self.lock)
  * 
  */
-    __pyx_t_5 = __pyx_f_6mtrand_cont1_array_sc(__pyx_v_self->internal_state, rk_power, __pyx_v_size, __pyx_v_fa, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2983, __pyx_L1_error)
+    __pyx_t_5 = __pyx_f_6mtrand_cont1_array_sc(__pyx_v_self->internal_state, rk_power, __pyx_v_size, __pyx_v_fa, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2988, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __pyx_r = __pyx_t_5;
     __pyx_t_5 = 0;
     goto __pyx_L0;
 
-    /* "mtrand.pyx":2979
+    /* "mtrand.pyx":2984
  *         oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if oa.shape == ():             # <<<<<<<<<<<<<<
@@ -26359,21 +26422,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_66power(struct __pyx_obj_6mtrand
  */
   }
 
-  /* "mtrand.pyx":2986
+  /* "mtrand.pyx":2991
  *                                   self.lock)
  * 
  *         if np.any(np.signbit(oa)):             # <<<<<<<<<<<<<<
  *             raise ValueError("a < 0")
  *         return cont1_array(self.internal_state, rk_power, size, oa, self.lock)
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2986, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2991, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_any); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2986, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_any); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2991, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2986, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2991, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_signbit); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2986, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_signbit); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2991, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   __pyx_t_6 = NULL;
@@ -26388,7 +26451,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_66power(struct __pyx_obj_6mtrand
   }
   __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_6, ((PyObject *)__pyx_v_oa)) : __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_v_oa));
   __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2986, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2991, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   __pyx_t_7 = NULL;
@@ -26404,27 +26467,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_66power(struct __pyx_obj_6mtrand
   __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1);
   __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2986, __pyx_L1_error)
+  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2991, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2986, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2991, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   if (unlikely(__pyx_t_3)) {
 
-    /* "mtrand.pyx":2987
+    /* "mtrand.pyx":2992
  * 
  *         if np.any(np.signbit(oa)):
  *             raise ValueError("a < 0")             # <<<<<<<<<<<<<<
  *         return cont1_array(self.internal_state, rk_power, size, oa, self.lock)
  * 
  */
-    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2987, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2992, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_Raise(__pyx_t_5, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __PYX_ERR(0, 2987, __pyx_L1_error)
+    __PYX_ERR(0, 2992, __pyx_L1_error)
 
-    /* "mtrand.pyx":2986
+    /* "mtrand.pyx":2991
  *                                   self.lock)
  * 
  *         if np.any(np.signbit(oa)):             # <<<<<<<<<<<<<<
@@ -26433,7 +26496,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_66power(struct __pyx_obj_6mtrand
  */
   }
 
-  /* "mtrand.pyx":2988
+  /* "mtrand.pyx":2993
  *         if np.any(np.signbit(oa)):
  *             raise ValueError("a < 0")
  *         return cont1_array(self.internal_state, rk_power, size, oa, self.lock)             # <<<<<<<<<<<<<<
@@ -26443,14 +26506,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_66power(struct __pyx_obj_6mtrand
   __Pyx_XDECREF(__pyx_r);
   __pyx_t_5 = __pyx_v_self->lock;
   __Pyx_INCREF(__pyx_t_5);
-  __pyx_t_2 = __pyx_f_6mtrand_cont1_array(__pyx_v_self->internal_state, rk_power, __pyx_v_size, __pyx_v_oa, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2988, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_6mtrand_cont1_array(__pyx_v_self->internal_state, rk_power, __pyx_v_size, __pyx_v_oa, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2993, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   __pyx_r = __pyx_t_2;
   __pyx_t_2 = 0;
   goto __pyx_L0;
 
-  /* "mtrand.pyx":2879
+  /* "mtrand.pyx":2884
  *                            self.lock)
  * 
  *     def power(self, a, size=None):             # <<<<<<<<<<<<<<
@@ -26474,7 +26537,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_66power(struct __pyx_obj_6mtrand
   return __pyx_r;
 }
 
-/* "mtrand.pyx":2990
+/* "mtrand.pyx":2995
  *         return cont1_array(self.internal_state, rk_power, size, oa, self.lock)
  * 
  *     def laplace(self, loc=0.0, scale=1.0, size=None):             # <<<<<<<<<<<<<<
@@ -26532,7 +26595,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_69laplace(PyObject *__pyx_v_self
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "laplace") < 0)) __PYX_ERR(0, 2990, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "laplace") < 0)) __PYX_ERR(0, 2995, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -26552,7 +26615,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_69laplace(PyObject *__pyx_v_self
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("laplace", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2990, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("laplace", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2995, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("mtrand.RandomState.laplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -26581,87 +26644,87 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_68laplace(struct __pyx_obj_6mtra
   PyObject *__pyx_t_7 = NULL;
   __Pyx_RefNannySetupContext("laplace", 0);
 
-  /* "mtrand.pyx":3072
+  /* "mtrand.pyx":3077
  *         cdef double floc, fscale
  * 
  *         oloc = PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ARRAY_ALIGNED)             # <<<<<<<<<<<<<<
  *         oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  */
-  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_loc, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3072, __pyx_L1_error)
+  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_loc, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3077, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6mtrand_ndarray))))) __PYX_ERR(0, 3072, __pyx_L1_error)
+  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6mtrand_ndarray))))) __PYX_ERR(0, 3077, __pyx_L1_error)
   __pyx_v_oloc = ((PyArrayObject *)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "mtrand.pyx":3073
+  /* "mtrand.pyx":3078
  * 
  *         oloc = PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  *         oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)             # <<<<<<<<<<<<<<
  * 
  *         if oloc.shape == oscale.shape == ():
  */
-  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3073, __pyx_L1_error)
+  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3078, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6mtrand_ndarray))))) __PYX_ERR(0, 3073, __pyx_L1_error)
+  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6mtrand_ndarray))))) __PYX_ERR(0, 3078, __pyx_L1_error)
   __pyx_v_oscale = ((PyArrayObject *)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "mtrand.pyx":3075
+  /* "mtrand.pyx":3080
  *         oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if oloc.shape == oscale.shape == ():             # <<<<<<<<<<<<<<
  *             floc = PyFloat_AsDouble(loc)
  *             fscale = PyFloat_AsDouble(scale)
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_oloc), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3075, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_oloc), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3080, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_oscale), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3075, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_oscale), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3080, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3075, __pyx_L1_error)
+  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3080, __pyx_L1_error)
   if (__Pyx_PyObject_IsTrue(__pyx_t_3)) {
     __Pyx_DECREF(__pyx_t_3);
-    __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3075, __pyx_L1_error)
+    __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3080, __pyx_L1_error)
   }
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3075, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3080, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   if (__pyx_t_4) {
 
-    /* "mtrand.pyx":3076
+    /* "mtrand.pyx":3081
  * 
  *         if oloc.shape == oscale.shape == ():
  *             floc = PyFloat_AsDouble(loc)             # <<<<<<<<<<<<<<
  *             fscale = PyFloat_AsDouble(scale)
  *             if np.signbit(fscale):
  */
-    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_loc); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 3076, __pyx_L1_error)
+    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_loc); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 3081, __pyx_L1_error)
     __pyx_v_floc = __pyx_t_5;
 
-    /* "mtrand.pyx":3077
+    /* "mtrand.pyx":3082
  *         if oloc.shape == oscale.shape == ():
  *             floc = PyFloat_AsDouble(loc)
  *             fscale = PyFloat_AsDouble(scale)             # <<<<<<<<<<<<<<
  *             if np.signbit(fscale):
  *                 raise ValueError("scale < 0")
  */
-    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_scale); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 3077, __pyx_L1_error)
+    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_scale); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 3082, __pyx_L1_error)
     __pyx_v_fscale = __pyx_t_5;
 
-    /* "mtrand.pyx":3078
+    /* "mtrand.pyx":3083
  *             floc = PyFloat_AsDouble(loc)
  *             fscale = PyFloat_AsDouble(scale)
  *             if np.signbit(fscale):             # <<<<<<<<<<<<<<
  *                 raise ValueError("scale < 0")
  *             return cont2_array_sc(self.internal_state, rk_laplace, size, floc,
  */
-    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3078, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3083, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_signbit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3078, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_signbit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3083, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_fscale); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3078, __pyx_L1_error)
+    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_fscale); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3083, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_t_6 = NULL;
     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
@@ -26676,27 +26739,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_68laplace(struct __pyx_obj_6mtra
     __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2);
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3078, __pyx_L1_error)
+    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3083, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3078, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3083, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     if (unlikely(__pyx_t_4)) {
 
-      /* "mtrand.pyx":3079
+      /* "mtrand.pyx":3084
  *             fscale = PyFloat_AsDouble(scale)
  *             if np.signbit(fscale):
  *                 raise ValueError("scale < 0")             # <<<<<<<<<<<<<<
  *             return cont2_array_sc(self.internal_state, rk_laplace, size, floc,
  *                                   fscale, self.lock)
  */
-      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3079, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3084, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __PYX_ERR(0, 3079, __pyx_L1_error)
+      __PYX_ERR(0, 3084, __pyx_L1_error)
 
-      /* "mtrand.pyx":3078
+      /* "mtrand.pyx":3083
  *             floc = PyFloat_AsDouble(loc)
  *             fscale = PyFloat_AsDouble(scale)
  *             if np.signbit(fscale):             # <<<<<<<<<<<<<<
@@ -26705,7 +26768,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_68laplace(struct __pyx_obj_6mtra
  */
     }
 
-    /* "mtrand.pyx":3080
+    /* "mtrand.pyx":3085
  *             if np.signbit(fscale):
  *                 raise ValueError("scale < 0")
  *             return cont2_array_sc(self.internal_state, rk_laplace, size, floc,             # <<<<<<<<<<<<<<
@@ -26714,7 +26777,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_68laplace(struct __pyx_obj_6mtra
  */
     __Pyx_XDECREF(__pyx_r);
 
-    /* "mtrand.pyx":3081
+    /* "mtrand.pyx":3086
  *                 raise ValueError("scale < 0")
  *             return cont2_array_sc(self.internal_state, rk_laplace, size, floc,
  *                                   fscale, self.lock)             # <<<<<<<<<<<<<<
@@ -26724,21 +26787,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_68laplace(struct __pyx_obj_6mtra
     __pyx_t_3 = __pyx_v_self->lock;
     __Pyx_INCREF(__pyx_t_3);
 
-    /* "mtrand.pyx":3080
+    /* "mtrand.pyx":3085
  *             if np.signbit(fscale):
  *                 raise ValueError("scale < 0")
  *             return cont2_array_sc(self.internal_state, rk_laplace, size, floc,             # <<<<<<<<<<<<<<
  *                                   fscale, self.lock)
  * 
  */
-    __pyx_t_1 = __pyx_f_6mtrand_cont2_array_sc(__pyx_v_self->internal_state, rk_laplace, __pyx_v_size, __pyx_v_floc, __pyx_v_fscale, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3080, __pyx_L1_error)
+    __pyx_t_1 = __pyx_f_6mtrand_cont2_array_sc(__pyx_v_self->internal_state, rk_laplace, __pyx_v_size, __pyx_v_floc, __pyx_v_fscale, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3085, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __pyx_r = __pyx_t_1;
     __pyx_t_1 = 0;
     goto __pyx_L0;
 
-    /* "mtrand.pyx":3075
+    /* "mtrand.pyx":3080
  *         oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if oloc.shape == oscale.shape == ():             # <<<<<<<<<<<<<<
@@ -26747,21 +26810,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_68laplace(struct __pyx_obj_6mtra
  */
   }
 
-  /* "mtrand.pyx":3083
+  /* "mtrand.pyx":3088
  *                                   fscale, self.lock)
  * 
  *         if np.any(np.signbit(oscale)):             # <<<<<<<<<<<<<<
  *             raise ValueError("scale < 0")
  *         return cont2_array(self.internal_state, rk_laplace, size, oloc, oscale,
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3083, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3088, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_any); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3083, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_any); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3088, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3083, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3088, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_signbit); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3083, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_signbit); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3088, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   __pyx_t_6 = NULL;
@@ -26776,7 +26839,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_68laplace(struct __pyx_obj_6mtra
   }
   __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_6, ((PyObject *)__pyx_v_oscale)) : __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_v_oscale));
   __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3083, __pyx_L1_error)
+  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3088, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   __pyx_t_7 = NULL;
@@ -26792,27 +26855,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_68laplace(struct __pyx_obj_6mtra
   __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
   __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3083, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3088, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3083, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3088, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (unlikely(__pyx_t_4)) {
 
-    /* "mtrand.pyx":3084
+    /* "mtrand.pyx":3089
  * 
  *         if np.any(np.signbit(oscale)):
  *             raise ValueError("scale < 0")             # <<<<<<<<<<<<<<
  *         return cont2_array(self.internal_state, rk_laplace, size, oloc, oscale,
  *                            self.lock)
  */
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3084, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3089, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __PYX_ERR(0, 3084, __pyx_L1_error)
+    __PYX_ERR(0, 3089, __pyx_L1_error)
 
-    /* "mtrand.pyx":3083
+    /* "mtrand.pyx":3088
  *                                   fscale, self.lock)
  * 
  *         if np.any(np.signbit(oscale)):             # <<<<<<<<<<<<<<
@@ -26821,7 +26884,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_68laplace(struct __pyx_obj_6mtra
  */
   }
 
-  /* "mtrand.pyx":3085
+  /* "mtrand.pyx":3090
  *         if np.any(np.signbit(oscale)):
  *             raise ValueError("scale < 0")
  *         return cont2_array(self.internal_state, rk_laplace, size, oloc, oscale,             # <<<<<<<<<<<<<<
@@ -26830,7 +26893,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_68laplace(struct __pyx_obj_6mtra
  */
   __Pyx_XDECREF(__pyx_r);
 
-  /* "mtrand.pyx":3086
+  /* "mtrand.pyx":3091
  *             raise ValueError("scale < 0")
  *         return cont2_array(self.internal_state, rk_laplace, size, oloc, oscale,
  *                            self.lock)             # <<<<<<<<<<<<<<
@@ -26840,21 +26903,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_68laplace(struct __pyx_obj_6mtra
   __pyx_t_1 = __pyx_v_self->lock;
   __Pyx_INCREF(__pyx_t_1);
 
-  /* "mtrand.pyx":3085
+  /* "mtrand.pyx":3090
  *         if np.any(np.signbit(oscale)):
  *             raise ValueError("scale < 0")
  *         return cont2_array(self.internal_state, rk_laplace, size, oloc, oscale,             # <<<<<<<<<<<<<<
  *                            self.lock)
  * 
  */
-  __pyx_t_2 = __pyx_f_6mtrand_cont2_array(__pyx_v_self->internal_state, rk_laplace, __pyx_v_size, __pyx_v_oloc, __pyx_v_oscale, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3085, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_6mtrand_cont2_array(__pyx_v_self->internal_state, rk_laplace, __pyx_v_size, __pyx_v_oloc, __pyx_v_oscale, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3090, __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;
 
-  /* "mtrand.pyx":2990
+  /* "mtrand.pyx":2995
  *         return cont1_array(self.internal_state, rk_power, size, oa, self.lock)
  * 
  *     def laplace(self, loc=0.0, scale=1.0, size=None):             # <<<<<<<<<<<<<<
@@ -26879,7 +26942,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_68laplace(struct __pyx_obj_6mtra
   return __pyx_r;
 }
 
-/* "mtrand.pyx":3088
+/* "mtrand.pyx":3093
  *                            self.lock)
  * 
  *     def gumbel(self, loc=0.0, scale=1.0, size=None):             # <<<<<<<<<<<<<<
@@ -26937,7 +27000,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_71gumbel(PyObject *__pyx_v_self,
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gumbel") < 0)) __PYX_ERR(0, 3088, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gumbel") < 0)) __PYX_ERR(0, 3093, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -26957,7 +27020,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_71gumbel(PyObject *__pyx_v_self,
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("gumbel", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3088, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("gumbel", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3093, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("mtrand.RandomState.gumbel", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -26986,87 +27049,87 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_70gumbel(struct __pyx_obj_6mtran
   PyObject *__pyx_t_7 = NULL;
   __Pyx_RefNannySetupContext("gumbel", 0);
 
-  /* "mtrand.pyx":3203
+  /* "mtrand.pyx":3208
  *         cdef double floc, fscale
  * 
  *         oloc = PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ARRAY_ALIGNED)             # <<<<<<<<<<<<<<
  *         oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  */
-  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_loc, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3203, __pyx_L1_error)
+  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_loc, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3208, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6mtrand_ndarray))))) __PYX_ERR(0, 3203, __pyx_L1_error)
+  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6mtrand_ndarray))))) __PYX_ERR(0, 3208, __pyx_L1_error)
   __pyx_v_oloc = ((PyArrayObject *)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "mtrand.pyx":3204
+  /* "mtrand.pyx":3209
  * 
  *         oloc = PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  *         oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)             # <<<<<<<<<<<<<<
  * 
  *         if oloc.shape == oscale.shape == ():
  */
-  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3204, __pyx_L1_error)
+  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3209, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6mtrand_ndarray))))) __PYX_ERR(0, 3204, __pyx_L1_error)
+  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6mtrand_ndarray))))) __PYX_ERR(0, 3209, __pyx_L1_error)
   __pyx_v_oscale = ((PyArrayObject *)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "mtrand.pyx":3206
+  /* "mtrand.pyx":3211
  *         oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if oloc.shape == oscale.shape == ():             # <<<<<<<<<<<<<<
  *             floc = PyFloat_AsDouble(loc)
  *             fscale = PyFloat_AsDouble(scale)
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_oloc), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3206, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_oloc), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3211, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_oscale), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3206, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_oscale), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3211, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3206, __pyx_L1_error)
+  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3211, __pyx_L1_error)
   if (__Pyx_PyObject_IsTrue(__pyx_t_3)) {
     __Pyx_DECREF(__pyx_t_3);
-    __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3206, __pyx_L1_error)
+    __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3211, __pyx_L1_error)
   }
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3206, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3211, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   if (__pyx_t_4) {
 
-    /* "mtrand.pyx":3207
+    /* "mtrand.pyx":3212
  * 
  *         if oloc.shape == oscale.shape == ():
  *             floc = PyFloat_AsDouble(loc)             # <<<<<<<<<<<<<<
  *             fscale = PyFloat_AsDouble(scale)
  *             if np.signbit(fscale):
  */
-    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_loc); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 3207, __pyx_L1_error)
+    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_loc); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 3212, __pyx_L1_error)
     __pyx_v_floc = __pyx_t_5;
 
-    /* "mtrand.pyx":3208
+    /* "mtrand.pyx":3213
  *         if oloc.shape == oscale.shape == ():
  *             floc = PyFloat_AsDouble(loc)
  *             fscale = PyFloat_AsDouble(scale)             # <<<<<<<<<<<<<<
  *             if np.signbit(fscale):
  *                 raise ValueError("scale < 0")
  */
-    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_scale); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 3208, __pyx_L1_error)
+    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_scale); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 3213, __pyx_L1_error)
     __pyx_v_fscale = __pyx_t_5;
 
-    /* "mtrand.pyx":3209
+    /* "mtrand.pyx":3214
  *             floc = PyFloat_AsDouble(loc)
  *             fscale = PyFloat_AsDouble(scale)
  *             if np.signbit(fscale):             # <<<<<<<<<<<<<<
  *                 raise ValueError("scale < 0")
  *             return cont2_array_sc(self.internal_state, rk_gumbel, size, floc,
  */
-    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3209, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3214, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_signbit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3209, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_signbit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3214, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_fscale); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3209, __pyx_L1_error)
+    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_fscale); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3214, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_t_6 = NULL;
     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
@@ -27081,27 +27144,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_70gumbel(struct __pyx_obj_6mtran
     __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2);
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3209, __pyx_L1_error)
+    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3214, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3209, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3214, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     if (unlikely(__pyx_t_4)) {
 
-      /* "mtrand.pyx":3210
+      /* "mtrand.pyx":3215
  *             fscale = PyFloat_AsDouble(scale)
  *             if np.signbit(fscale):
  *                 raise ValueError("scale < 0")             # <<<<<<<<<<<<<<
  *             return cont2_array_sc(self.internal_state, rk_gumbel, size, floc,
  *                                   fscale, self.lock)
  */
-      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3210, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3215, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __PYX_ERR(0, 3210, __pyx_L1_error)
+      __PYX_ERR(0, 3215, __pyx_L1_error)
 
-      /* "mtrand.pyx":3209
+      /* "mtrand.pyx":3214
  *             floc = PyFloat_AsDouble(loc)
  *             fscale = PyFloat_AsDouble(scale)
  *             if np.signbit(fscale):             # <<<<<<<<<<<<<<
@@ -27110,7 +27173,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_70gumbel(struct __pyx_obj_6mtran
  */
     }
 
-    /* "mtrand.pyx":3211
+    /* "mtrand.pyx":3216
  *             if np.signbit(fscale):
  *                 raise ValueError("scale < 0")
  *             return cont2_array_sc(self.internal_state, rk_gumbel, size, floc,             # <<<<<<<<<<<<<<
@@ -27119,7 +27182,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_70gumbel(struct __pyx_obj_6mtran
  */
     __Pyx_XDECREF(__pyx_r);
 
-    /* "mtrand.pyx":3212
+    /* "mtrand.pyx":3217
  *                 raise ValueError("scale < 0")
  *             return cont2_array_sc(self.internal_state, rk_gumbel, size, floc,
  *                                   fscale, self.lock)             # <<<<<<<<<<<<<<
@@ -27129,21 +27192,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_70gumbel(struct __pyx_obj_6mtran
     __pyx_t_3 = __pyx_v_self->lock;
     __Pyx_INCREF(__pyx_t_3);
 
-    /* "mtrand.pyx":3211
+    /* "mtrand.pyx":3216
  *             if np.signbit(fscale):
  *                 raise ValueError("scale < 0")
  *             return cont2_array_sc(self.internal_state, rk_gumbel, size, floc,             # <<<<<<<<<<<<<<
  *                                   fscale, self.lock)
  * 
  */
-    __pyx_t_1 = __pyx_f_6mtrand_cont2_array_sc(__pyx_v_self->internal_state, rk_gumbel, __pyx_v_size, __pyx_v_floc, __pyx_v_fscale, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3211, __pyx_L1_error)
+    __pyx_t_1 = __pyx_f_6mtrand_cont2_array_sc(__pyx_v_self->internal_state, rk_gumbel, __pyx_v_size, __pyx_v_floc, __pyx_v_fscale, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3216, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __pyx_r = __pyx_t_1;
     __pyx_t_1 = 0;
     goto __pyx_L0;
 
-    /* "mtrand.pyx":3206
+    /* "mtrand.pyx":3211
  *         oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if oloc.shape == oscale.shape == ():             # <<<<<<<<<<<<<<
@@ -27152,21 +27215,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_70gumbel(struct __pyx_obj_6mtran
  */
   }
 
-  /* "mtrand.pyx":3214
+  /* "mtrand.pyx":3219
  *                                   fscale, self.lock)
  * 
  *         if np.any(np.signbit(oscale)):             # <<<<<<<<<<<<<<
  *             raise ValueError("scale < 0")
  *         return cont2_array(self.internal_state, rk_gumbel, size, oloc, oscale,
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3214, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3219, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_any); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3214, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_any); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3219, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3214, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3219, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_signbit); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3214, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_signbit); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3219, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   __pyx_t_6 = NULL;
@@ -27181,7 +27244,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_70gumbel(struct __pyx_obj_6mtran
   }
   __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_6, ((PyObject *)__pyx_v_oscale)) : __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_v_oscale));
   __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3214, __pyx_L1_error)
+  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3219, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   __pyx_t_7 = NULL;
@@ -27197,27 +27260,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_70gumbel(struct __pyx_obj_6mtran
   __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
   __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3214, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3219, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3214, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3219, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (unlikely(__pyx_t_4)) {
 
-    /* "mtrand.pyx":3215
+    /* "mtrand.pyx":3220
  * 
  *         if np.any(np.signbit(oscale)):
  *             raise ValueError("scale < 0")             # <<<<<<<<<<<<<<
  *         return cont2_array(self.internal_state, rk_gumbel, size, oloc, oscale,
  *                            self.lock)
  */
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3215, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3220, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __PYX_ERR(0, 3215, __pyx_L1_error)
+    __PYX_ERR(0, 3220, __pyx_L1_error)
 
-    /* "mtrand.pyx":3214
+    /* "mtrand.pyx":3219
  *                                   fscale, self.lock)
  * 
  *         if np.any(np.signbit(oscale)):             # <<<<<<<<<<<<<<
@@ -27226,7 +27289,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_70gumbel(struct __pyx_obj_6mtran
  */
   }
 
-  /* "mtrand.pyx":3216
+  /* "mtrand.pyx":3221
  *         if np.any(np.signbit(oscale)):
  *             raise ValueError("scale < 0")
  *         return cont2_array(self.internal_state, rk_gumbel, size, oloc, oscale,             # <<<<<<<<<<<<<<
@@ -27235,7 +27298,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_70gumbel(struct __pyx_obj_6mtran
  */
   __Pyx_XDECREF(__pyx_r);
 
-  /* "mtrand.pyx":3217
+  /* "mtrand.pyx":3222
  *             raise ValueError("scale < 0")
  *         return cont2_array(self.internal_state, rk_gumbel, size, oloc, oscale,
  *                            self.lock)             # <<<<<<<<<<<<<<
@@ -27245,21 +27308,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_70gumbel(struct __pyx_obj_6mtran
   __pyx_t_1 = __pyx_v_self->lock;
   __Pyx_INCREF(__pyx_t_1);
 
-  /* "mtrand.pyx":3216
+  /* "mtrand.pyx":3221
  *         if np.any(np.signbit(oscale)):
  *             raise ValueError("scale < 0")
  *         return cont2_array(self.internal_state, rk_gumbel, size, oloc, oscale,             # <<<<<<<<<<<<<<
  *                            self.lock)
  * 
  */
-  __pyx_t_2 = __pyx_f_6mtrand_cont2_array(__pyx_v_self->internal_state, rk_gumbel, __pyx_v_size, __pyx_v_oloc, __pyx_v_oscale, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3216, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_6mtrand_cont2_array(__pyx_v_self->internal_state, rk_gumbel, __pyx_v_size, __pyx_v_oloc, __pyx_v_oscale, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3221, __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;
 
-  /* "mtrand.pyx":3088
+  /* "mtrand.pyx":3093
  *                            self.lock)
  * 
  *     def gumbel(self, loc=0.0, scale=1.0, size=None):             # <<<<<<<<<<<<<<
@@ -27284,7 +27347,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_70gumbel(struct __pyx_obj_6mtran
   return __pyx_r;
 }
 
-/* "mtrand.pyx":3219
+/* "mtrand.pyx":3224
  *                            self.lock)
  * 
  *     def logistic(self, loc=0.0, scale=1.0, size=None):             # <<<<<<<<<<<<<<
@@ -27294,7 +27357,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_70gumbel(struct __pyx_obj_6mtran
 
 /* Python wrapper */
 static PyObject *__pyx_pw_6mtrand_11RandomState_73logistic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_72logistic[] = "\n        logistic(loc=0.0, scale=1.0, size=None)\n\n        Draw samples from a logistic distribution.\n\n        Samples are drawn from a logistic distribution with specified\n        parameters, loc (location or mean, also median), and scale (>0).\n\n        Parameters\n        ----------\n        loc : float or array_like of floats, optional\n            Parameter of the distribution. Default is 0.\n        scale : float or array_like of floats, optional\n            Parameter of the distribution. Should be greater than zero.\n            Default is 1.\n        size : int or tuple of ints, optional\n            Output shape.  If the given shape is, e.g., ``(m, n, k)``, then\n            ``m * n * k`` samples are drawn.  If size is ``None`` (default),\n            a single value is returned if ``loc`` and ``scale`` are both scalars.\n            Otherwise, ``np.broadcast(loc, scale).size`` samples are drawn.\n\n        Returns\n        -------\n        out : ndarray or scalar\n            Drawn samples from the parameterized logistic distribution.\n\n        See Also\n        --------\n        scipy.stats.logistic : probability density function, distribution or\n            cumulative density function, etc.\n\n        Notes\n        -----\n        The probability density for the Logistic distribution is\n\n        .. math:: P(x) = P(x) = \\frac{e^{-(x-\\mu)/s}}{s(1+e^{-(x-\\mu)/s})^2},\n\n        where :math:`\\mu` = location and :math:`s` = scale.\n\n        The Logistic distribution is used in Extreme Value problems where it\n        can act as a mixture of Gumbel distributions, in Epidemiology, and by\n        the World Chess Federation (FIDE) where it is used in the Elo ranking\n        system, assuming the performance of each player is a logistically\n        distributed random variable.\n\n        References\n        ----------\n        .. [1] Reiss, R.-D. and Thomas M. (2001), \"Statistical Analysis of\n               Extreme Values, from Insurance, Financ""e, Hydrology and Other\n               Fields,\" Birkhauser Verlag, Basel, pp 132-133.\n        .. [2] Weisstein, Eric W. \"Logistic Distribution.\" From\n               MathWorld--A Wolfram Web Resource.\n               http://mathworld.wolfram.com/LogisticDistribution.html\n        .. [3] Wikipedia, \"Logistic-distribution\",\n               https://en.wikipedia.org/wiki/Logistic_distribution\n\n        Examples\n        --------\n        Draw samples from the distribution:\n\n        >>> loc, scale = 10, 1\n        >>> s = np.random.logistic(loc, scale, 10000)\n        >>> count, bins, ignored = plt.hist(s, bins=50)\n\n        #   plot against distribution\n\n        >>> def logist(x, loc, scale):\n        ...     return exp((loc-x)/scale)/(scale*(1+exp((loc-x)/scale))**2)\n        >>> plt.plot(bins, logist(bins, loc, scale)*count.max()/\\\n        ... logist(bins, loc, scale).max())\n        >>> plt.show()\n\n        ";
+static char __pyx_doc_6mtrand_11RandomState_72logistic[] = "\n        logistic(loc=0.0, scale=1.0, size=None)\n\n        Draw samples from a logistic distribution.\n\n        Samples are drawn from a logistic distribution with specified\n        parameters, loc (location or mean, also median), and scale (>0).\n\n        Parameters\n        ----------\n        loc : float or array_like of floats, optional\n            Parameter of the distribution. Default is 0.\n        scale : float or array_like of floats, optional\n            Parameter of the distribution. Should be greater than zero.\n            Default is 1.\n        size : int or tuple of ints, optional\n            Output shape.  If the given shape is, e.g., ``(m, n, k)``, then\n            ``m * n * k`` samples are drawn.  If size is ``None`` (default),\n            a single value is returned if ``loc`` and ``scale`` are both scalars.\n            Otherwise, ``np.broadcast(loc, scale).size`` samples are drawn.\n\n        Returns\n        -------\n        out : ndarray or scalar\n            Drawn samples from the parameterized logistic distribution.\n\n        See Also\n        --------\n        scipy.stats.logistic : probability density function, distribution or\n            cumulative density function, etc.\n\n        Notes\n        -----\n        The probability density for the Logistic distribution is\n\n        .. math:: P(x) = P(x) = \\frac{e^{-(x-\\mu)/s}}{s(1+e^{-(x-\\mu)/s})^2},\n\n        where :math:`\\mu` = location and :math:`s` = scale.\n\n        The Logistic distribution is used in Extreme Value problems where it\n        can act as a mixture of Gumbel distributions, in Epidemiology, and by\n        the World Chess Federation (FIDE) where it is used in the Elo ranking\n        system, assuming the performance of each player is a logistically\n        distributed random variable.\n\n        References\n        ----------\n        .. [1] Reiss, R.-D. and Thomas M. (2001), \"Statistical Analysis of\n               Extreme Values, from Insurance, Financ""e, Hydrology and Other\n               Fields,\" Birkhauser Verlag, Basel, pp 132-133.\n        .. [2] Weisstein, Eric W. \"Logistic Distribution.\" From\n               MathWorld--A Wolfram Web Resource.\n               http://mathworld.wolfram.com/LogisticDistribution.html\n        .. [3] Wikipedia, \"Logistic-distribution\",\n               https://en.wikipedia.org/wiki/Logistic_distribution\n\n        Examples\n        --------\n        Draw samples from the distribution:\n\n        >>> loc, scale = 10, 1\n        >>> s = np.random.logistic(loc, scale, 10000)\n        >>> import matplotlib.pyplot as plt\n        >>> count, bins, ignored = plt.hist(s, bins=50)\n\n        #   plot against distribution\n\n        >>> def logist(x, loc, scale):\n        ...     return exp((loc-x)/scale)/(scale*(1+exp((loc-x)/scale))**2)\n        >>> plt.plot(bins, logist(bins, loc, scale)*count.max()/\\\n        ... logist(bins, loc, scale).max())\n        >>> plt.show()\n\n        ";
 static PyObject *__pyx_pw_6mtrand_11RandomState_73logistic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyObject *__pyx_v_loc = 0;
   PyObject *__pyx_v_scale = 0;
@@ -27342,7 +27405,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_73logistic(PyObject *__pyx_v_sel
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "logistic") < 0)) __PYX_ERR(0, 3219, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "logistic") < 0)) __PYX_ERR(0, 3224, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -27362,7 +27425,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_73logistic(PyObject *__pyx_v_sel
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("logistic", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3219, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("logistic", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3224, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("mtrand.RandomState.logistic", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -27391,87 +27454,87 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_72logistic(struct __pyx_obj_6mtr
   PyObject *__pyx_t_7 = NULL;
   __Pyx_RefNannySetupContext("logistic", 0);
 
-  /* "mtrand.pyx":3296
+  /* "mtrand.pyx":3302
  *         cdef double floc, fscale
  * 
  *         oloc = PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ARRAY_ALIGNED)             # <<<<<<<<<<<<<<
  *         oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  */
-  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_loc, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3296, __pyx_L1_error)
+  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_loc, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3302, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6mtrand_ndarray))))) __PYX_ERR(0, 3296, __pyx_L1_error)
+  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6mtrand_ndarray))))) __PYX_ERR(0, 3302, __pyx_L1_error)
   __pyx_v_oloc = ((PyArrayObject *)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "mtrand.pyx":3297
+  /* "mtrand.pyx":3303
  * 
  *         oloc = PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  *         oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)             # <<<<<<<<<<<<<<
  * 
  *         if oloc.shape == oscale.shape == ():
  */
-  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3297, __pyx_L1_error)
+  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3303, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6mtrand_ndarray))))) __PYX_ERR(0, 3297, __pyx_L1_error)
+  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6mtrand_ndarray))))) __PYX_ERR(0, 3303, __pyx_L1_error)
   __pyx_v_oscale = ((PyArrayObject *)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "mtrand.pyx":3299
+  /* "mtrand.pyx":3305
  *         oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if oloc.shape == oscale.shape == ():             # <<<<<<<<<<<<<<
  *             floc = PyFloat_AsDouble(loc)
  *             fscale = PyFloat_AsDouble(scale)
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_oloc), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3299, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_oloc), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3305, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_oscale), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3299, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_oscale), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3305, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3299, __pyx_L1_error)
+  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3305, __pyx_L1_error)
   if (__Pyx_PyObject_IsTrue(__pyx_t_3)) {
     __Pyx_DECREF(__pyx_t_3);
-    __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3299, __pyx_L1_error)
+    __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3305, __pyx_L1_error)
   }
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3299, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3305, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   if (__pyx_t_4) {
 
-    /* "mtrand.pyx":3300
+    /* "mtrand.pyx":3306
  * 
  *         if oloc.shape == oscale.shape == ():
  *             floc = PyFloat_AsDouble(loc)             # <<<<<<<<<<<<<<
  *             fscale = PyFloat_AsDouble(scale)
  *             if np.signbit(fscale):
  */
-    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_loc); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 3300, __pyx_L1_error)
+    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_loc); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 3306, __pyx_L1_error)
     __pyx_v_floc = __pyx_t_5;
 
-    /* "mtrand.pyx":3301
+    /* "mtrand.pyx":3307
  *         if oloc.shape == oscale.shape == ():
  *             floc = PyFloat_AsDouble(loc)
  *             fscale = PyFloat_AsDouble(scale)             # <<<<<<<<<<<<<<
  *             if np.signbit(fscale):
  *                 raise ValueError("scale < 0")
  */
-    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_scale); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 3301, __pyx_L1_error)
+    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_scale); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 3307, __pyx_L1_error)
     __pyx_v_fscale = __pyx_t_5;
 
-    /* "mtrand.pyx":3302
+    /* "mtrand.pyx":3308
  *             floc = PyFloat_AsDouble(loc)
  *             fscale = PyFloat_AsDouble(scale)
  *             if np.signbit(fscale):             # <<<<<<<<<<<<<<
  *                 raise ValueError("scale < 0")
  *             return cont2_array_sc(self.internal_state, rk_logistic, size, floc,
  */
-    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3302, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3308, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_signbit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3302, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_signbit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3308, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_fscale); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3302, __pyx_L1_error)
+    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_fscale); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3308, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_t_6 = NULL;
     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
@@ -27486,27 +27549,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_72logistic(struct __pyx_obj_6mtr
     __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2);
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3302, __pyx_L1_error)
+    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3308, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3302, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3308, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     if (unlikely(__pyx_t_4)) {
 
-      /* "mtrand.pyx":3303
+      /* "mtrand.pyx":3309
  *             fscale = PyFloat_AsDouble(scale)
  *             if np.signbit(fscale):
  *                 raise ValueError("scale < 0")             # <<<<<<<<<<<<<<
  *             return cont2_array_sc(self.internal_state, rk_logistic, size, floc,
  *                                   fscale, self.lock)
  */
-      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3303, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3309, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __PYX_ERR(0, 3303, __pyx_L1_error)
+      __PYX_ERR(0, 3309, __pyx_L1_error)
 
-      /* "mtrand.pyx":3302
+      /* "mtrand.pyx":3308
  *             floc = PyFloat_AsDouble(loc)
  *             fscale = PyFloat_AsDouble(scale)
  *             if np.signbit(fscale):             # <<<<<<<<<<<<<<
@@ -27515,7 +27578,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_72logistic(struct __pyx_obj_6mtr
  */
     }
 
-    /* "mtrand.pyx":3304
+    /* "mtrand.pyx":3310
  *             if np.signbit(fscale):
  *                 raise ValueError("scale < 0")
  *             return cont2_array_sc(self.internal_state, rk_logistic, size, floc,             # <<<<<<<<<<<<<<
@@ -27524,7 +27587,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_72logistic(struct __pyx_obj_6mtr
  */
     __Pyx_XDECREF(__pyx_r);
 
-    /* "mtrand.pyx":3305
+    /* "mtrand.pyx":3311
  *                 raise ValueError("scale < 0")
  *             return cont2_array_sc(self.internal_state, rk_logistic, size, floc,
  *                                   fscale, self.lock)             # <<<<<<<<<<<<<<
@@ -27534,21 +27597,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_72logistic(struct __pyx_obj_6mtr
     __pyx_t_3 = __pyx_v_self->lock;
     __Pyx_INCREF(__pyx_t_3);
 
-    /* "mtrand.pyx":3304
+    /* "mtrand.pyx":3310
  *             if np.signbit(fscale):
  *                 raise ValueError("scale < 0")
  *             return cont2_array_sc(self.internal_state, rk_logistic, size, floc,             # <<<<<<<<<<<<<<
  *                                   fscale, self.lock)
  * 
  */
-    __pyx_t_1 = __pyx_f_6mtrand_cont2_array_sc(__pyx_v_self->internal_state, rk_logistic, __pyx_v_size, __pyx_v_floc, __pyx_v_fscale, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3304, __pyx_L1_error)
+    __pyx_t_1 = __pyx_f_6mtrand_cont2_array_sc(__pyx_v_self->internal_state, rk_logistic, __pyx_v_size, __pyx_v_floc, __pyx_v_fscale, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3310, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __pyx_r = __pyx_t_1;
     __pyx_t_1 = 0;
     goto __pyx_L0;
 
-    /* "mtrand.pyx":3299
+    /* "mtrand.pyx":3305
  *         oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if oloc.shape == oscale.shape == ():             # <<<<<<<<<<<<<<
@@ -27557,21 +27620,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_72logistic(struct __pyx_obj_6mtr
  */
   }
 
-  /* "mtrand.pyx":3307
+  /* "mtrand.pyx":3313
  *                                   fscale, self.lock)
  * 
  *         if np.any(np.signbit(oscale)):             # <<<<<<<<<<<<<<
  *             raise ValueError("scale < 0")
  *         return cont2_array(self.internal_state, rk_logistic, size, oloc,
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3307, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3313, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_any); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3307, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_any); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3313, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3307, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3313, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_signbit); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3307, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_signbit); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3313, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   __pyx_t_6 = NULL;
@@ -27586,7 +27649,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_72logistic(struct __pyx_obj_6mtr
   }
   __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_6, ((PyObject *)__pyx_v_oscale)) : __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_v_oscale));
   __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3307, __pyx_L1_error)
+  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3313, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   __pyx_t_7 = NULL;
@@ -27602,27 +27665,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_72logistic(struct __pyx_obj_6mtr
   __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
   __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3307, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3313, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3307, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3313, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (unlikely(__pyx_t_4)) {
 
-    /* "mtrand.pyx":3308
+    /* "mtrand.pyx":3314
  * 
  *         if np.any(np.signbit(oscale)):
  *             raise ValueError("scale < 0")             # <<<<<<<<<<<<<<
  *         return cont2_array(self.internal_state, rk_logistic, size, oloc,
  *                            oscale, self.lock)
  */
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3308, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3314, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __PYX_ERR(0, 3308, __pyx_L1_error)
+    __PYX_ERR(0, 3314, __pyx_L1_error)
 
-    /* "mtrand.pyx":3307
+    /* "mtrand.pyx":3313
  *                                   fscale, self.lock)
  * 
  *         if np.any(np.signbit(oscale)):             # <<<<<<<<<<<<<<
@@ -27631,7 +27694,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_72logistic(struct __pyx_obj_6mtr
  */
   }
 
-  /* "mtrand.pyx":3309
+  /* "mtrand.pyx":3315
  *         if np.any(np.signbit(oscale)):
  *             raise ValueError("scale < 0")
  *         return cont2_array(self.internal_state, rk_logistic, size, oloc,             # <<<<<<<<<<<<<<
@@ -27640,7 +27703,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_72logistic(struct __pyx_obj_6mtr
  */
   __Pyx_XDECREF(__pyx_r);
 
-  /* "mtrand.pyx":3310
+  /* "mtrand.pyx":3316
  *             raise ValueError("scale < 0")
  *         return cont2_array(self.internal_state, rk_logistic, size, oloc,
  *                            oscale, self.lock)             # <<<<<<<<<<<<<<
@@ -27650,21 +27713,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_72logistic(struct __pyx_obj_6mtr
   __pyx_t_1 = __pyx_v_self->lock;
   __Pyx_INCREF(__pyx_t_1);
 
-  /* "mtrand.pyx":3309
+  /* "mtrand.pyx":3315
  *         if np.any(np.signbit(oscale)):
  *             raise ValueError("scale < 0")
  *         return cont2_array(self.internal_state, rk_logistic, size, oloc,             # <<<<<<<<<<<<<<
  *                            oscale, self.lock)
  * 
  */
-  __pyx_t_2 = __pyx_f_6mtrand_cont2_array(__pyx_v_self->internal_state, rk_logistic, __pyx_v_size, __pyx_v_oloc, __pyx_v_oscale, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3309, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_6mtrand_cont2_array(__pyx_v_self->internal_state, rk_logistic, __pyx_v_size, __pyx_v_oloc, __pyx_v_oscale, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3315, __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;
 
-  /* "mtrand.pyx":3219
+  /* "mtrand.pyx":3224
  *                            self.lock)
  * 
  *     def logistic(self, loc=0.0, scale=1.0, size=None):             # <<<<<<<<<<<<<<
@@ -27689,7 +27752,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_72logistic(struct __pyx_obj_6mtr
   return __pyx_r;
 }
 
-/* "mtrand.pyx":3312
+/* "mtrand.pyx":3318
  *                            oscale, self.lock)
  * 
  *     def lognormal(self, mean=0.0, sigma=1.0, size=None):             # <<<<<<<<<<<<<<
@@ -27747,7 +27810,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_75lognormal(PyObject *__pyx_v_se
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lognormal") < 0)) __PYX_ERR(0, 3312, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lognormal") < 0)) __PYX_ERR(0, 3318, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -27767,7 +27830,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_75lognormal(PyObject *__pyx_v_se
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("lognormal", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3312, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("lognormal", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3318, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("mtrand.RandomState.lognormal", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -27796,87 +27859,87 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_74lognormal(struct __pyx_obj_6mt
   PyObject *__pyx_t_7 = NULL;
   __Pyx_RefNannySetupContext("lognormal", 0);
 
-  /* "mtrand.pyx":3420
+  /* "mtrand.pyx":3426
  *         cdef double fmean, fsigma
  * 
  *         omean = PyArray_FROM_OTF(mean, NPY_DOUBLE, NPY_ARRAY_ALIGNED)             # <<<<<<<<<<<<<<
  *         osigma = PyArray_FROM_OTF(sigma, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  */
-  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_mean, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3420, __pyx_L1_error)
+  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_mean, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3426, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6mtrand_ndarray))))) __PYX_ERR(0, 3420, __pyx_L1_error)
+  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6mtrand_ndarray))))) __PYX_ERR(0, 3426, __pyx_L1_error)
   __pyx_v_omean = ((PyArrayObject *)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "mtrand.pyx":3421
+  /* "mtrand.pyx":3427
  * 
  *         omean = PyArray_FROM_OTF(mean, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  *         osigma = PyArray_FROM_OTF(sigma, NPY_DOUBLE, NPY_ARRAY_ALIGNED)             # <<<<<<<<<<<<<<
  * 
  *         if omean.shape == osigma.shape == ():
  */
-  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_sigma, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3421, __pyx_L1_error)
+  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_sigma, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3427, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6mtrand_ndarray))))) __PYX_ERR(0, 3421, __pyx_L1_error)
+  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6mtrand_ndarray))))) __PYX_ERR(0, 3427, __pyx_L1_error)
   __pyx_v_osigma = ((PyArrayObject *)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "mtrand.pyx":3423
+  /* "mtrand.pyx":3429
  *         osigma = PyArray_FROM_OTF(sigma, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if omean.shape == osigma.shape == ():             # <<<<<<<<<<<<<<
  *             fmean = PyFloat_AsDouble(mean)
  *             fsigma = PyFloat_AsDouble(sigma)
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_omean), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3423, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_omean), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3429, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_osigma), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3423, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_osigma), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3429, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3423, __pyx_L1_error)
+  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3429, __pyx_L1_error)
   if (__Pyx_PyObject_IsTrue(__pyx_t_3)) {
     __Pyx_DECREF(__pyx_t_3);
-    __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3423, __pyx_L1_error)
+    __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3429, __pyx_L1_error)
   }
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3423, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3429, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   if (__pyx_t_4) {
 
-    /* "mtrand.pyx":3424
+    /* "mtrand.pyx":3430
  * 
  *         if omean.shape == osigma.shape == ():
  *             fmean = PyFloat_AsDouble(mean)             # <<<<<<<<<<<<<<
  *             fsigma = PyFloat_AsDouble(sigma)
  *             if np.signbit(fsigma):
  */
-    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_mean); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 3424, __pyx_L1_error)
+    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_mean); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 3430, __pyx_L1_error)
     __pyx_v_fmean = __pyx_t_5;
 
-    /* "mtrand.pyx":3425
+    /* "mtrand.pyx":3431
  *         if omean.shape == osigma.shape == ():
  *             fmean = PyFloat_AsDouble(mean)
  *             fsigma = PyFloat_AsDouble(sigma)             # <<<<<<<<<<<<<<
  *             if np.signbit(fsigma):
  *                 raise ValueError("sigma < 0")
  */
-    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_sigma); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 3425, __pyx_L1_error)
+    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_sigma); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 3431, __pyx_L1_error)
     __pyx_v_fsigma = __pyx_t_5;
 
-    /* "mtrand.pyx":3426
+    /* "mtrand.pyx":3432
  *             fmean = PyFloat_AsDouble(mean)
  *             fsigma = PyFloat_AsDouble(sigma)
  *             if np.signbit(fsigma):             # <<<<<<<<<<<<<<
  *                 raise ValueError("sigma < 0")
  *             return cont2_array_sc(self.internal_state, rk_lognormal, size,
  */
-    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3426, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3432, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_signbit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3426, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_signbit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3432, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_fsigma); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3426, __pyx_L1_error)
+    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_fsigma); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3432, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_t_6 = NULL;
     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
@@ -27891,27 +27954,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_74lognormal(struct __pyx_obj_6mt
     __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2);
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3426, __pyx_L1_error)
+    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3432, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3426, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3432, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     if (unlikely(__pyx_t_4)) {
 
-      /* "mtrand.pyx":3427
+      /* "mtrand.pyx":3433
  *             fsigma = PyFloat_AsDouble(sigma)
  *             if np.signbit(fsigma):
  *                 raise ValueError("sigma < 0")             # <<<<<<<<<<<<<<
  *             return cont2_array_sc(self.internal_state, rk_lognormal, size,
  *                                   fmean, fsigma, self.lock)
  */
-      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3427, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3433, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __PYX_ERR(0, 3427, __pyx_L1_error)
+      __PYX_ERR(0, 3433, __pyx_L1_error)
 
-      /* "mtrand.pyx":3426
+      /* "mtrand.pyx":3432
  *             fmean = PyFloat_AsDouble(mean)
  *             fsigma = PyFloat_AsDouble(sigma)
  *             if np.signbit(fsigma):             # <<<<<<<<<<<<<<
@@ -27920,7 +27983,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_74lognormal(struct __pyx_obj_6mt
  */
     }
 
-    /* "mtrand.pyx":3428
+    /* "mtrand.pyx":3434
  *             if np.signbit(fsigma):
  *                 raise ValueError("sigma < 0")
  *             return cont2_array_sc(self.internal_state, rk_lognormal, size,             # <<<<<<<<<<<<<<
@@ -27929,7 +27992,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_74lognormal(struct __pyx_obj_6mt
  */
     __Pyx_XDECREF(__pyx_r);
 
-    /* "mtrand.pyx":3429
+    /* "mtrand.pyx":3435
  *                 raise ValueError("sigma < 0")
  *             return cont2_array_sc(self.internal_state, rk_lognormal, size,
  *                                   fmean, fsigma, self.lock)             # <<<<<<<<<<<<<<
@@ -27939,21 +28002,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_74lognormal(struct __pyx_obj_6mt
     __pyx_t_3 = __pyx_v_self->lock;
     __Pyx_INCREF(__pyx_t_3);
 
-    /* "mtrand.pyx":3428
+    /* "mtrand.pyx":3434
  *             if np.signbit(fsigma):
  *                 raise ValueError("sigma < 0")
  *             return cont2_array_sc(self.internal_state, rk_lognormal, size,             # <<<<<<<<<<<<<<
  *                                   fmean, fsigma, self.lock)
  * 
  */
-    __pyx_t_1 = __pyx_f_6mtrand_cont2_array_sc(__pyx_v_self->internal_state, rk_lognormal, __pyx_v_size, __pyx_v_fmean, __pyx_v_fsigma, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3428, __pyx_L1_error)
+    __pyx_t_1 = __pyx_f_6mtrand_cont2_array_sc(__pyx_v_self->internal_state, rk_lognormal, __pyx_v_size, __pyx_v_fmean, __pyx_v_fsigma, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3434, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __pyx_r = __pyx_t_1;
     __pyx_t_1 = 0;
     goto __pyx_L0;
 
-    /* "mtrand.pyx":3423
+    /* "mtrand.pyx":3429
  *         osigma = PyArray_FROM_OTF(sigma, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if omean.shape == osigma.shape == ():             # <<<<<<<<<<<<<<
@@ -27962,21 +28025,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_74lognormal(struct __pyx_obj_6mt
  */
   }
 
-  /* "mtrand.pyx":3431
+  /* "mtrand.pyx":3437
  *                                   fmean, fsigma, self.lock)
  * 
  *         if np.any(np.signbit(osigma)):             # <<<<<<<<<<<<<<
  *             raise ValueError("sigma < 0.0")
  *         return cont2_array(self.internal_state, rk_lognormal, size, omean,
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3431, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3437, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_any); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3431, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_any); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3437, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3431, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3437, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_signbit); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3431, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_signbit); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3437, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   __pyx_t_6 = NULL;
@@ -27991,7 +28054,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_74lognormal(struct __pyx_obj_6mt
   }
   __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_6, ((PyObject *)__pyx_v_osigma)) : __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_v_osigma));
   __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3431, __pyx_L1_error)
+  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3437, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   __pyx_t_7 = NULL;
@@ -28007,27 +28070,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_74lognormal(struct __pyx_obj_6mt
   __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
   __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3431, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3437, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3431, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3437, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (unlikely(__pyx_t_4)) {
 
-    /* "mtrand.pyx":3432
+    /* "mtrand.pyx":3438
  * 
  *         if np.any(np.signbit(osigma)):
  *             raise ValueError("sigma < 0.0")             # <<<<<<<<<<<<<<
  *         return cont2_array(self.internal_state, rk_lognormal, size, omean,
  *                            osigma, self.lock)
  */
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3432, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3438, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __PYX_ERR(0, 3432, __pyx_L1_error)
+    __PYX_ERR(0, 3438, __pyx_L1_error)
 
-    /* "mtrand.pyx":3431
+    /* "mtrand.pyx":3437
  *                                   fmean, fsigma, self.lock)
  * 
  *         if np.any(np.signbit(osigma)):             # <<<<<<<<<<<<<<
@@ -28036,7 +28099,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_74lognormal(struct __pyx_obj_6mt
  */
   }
 
-  /* "mtrand.pyx":3433
+  /* "mtrand.pyx":3439
  *         if np.any(np.signbit(osigma)):
  *             raise ValueError("sigma < 0.0")
  *         return cont2_array(self.internal_state, rk_lognormal, size, omean,             # <<<<<<<<<<<<<<
@@ -28045,7 +28108,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_74lognormal(struct __pyx_obj_6mt
  */
   __Pyx_XDECREF(__pyx_r);
 
-  /* "mtrand.pyx":3434
+  /* "mtrand.pyx":3440
  *             raise ValueError("sigma < 0.0")
  *         return cont2_array(self.internal_state, rk_lognormal, size, omean,
  *                            osigma, self.lock)             # <<<<<<<<<<<<<<
@@ -28055,21 +28118,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_74lognormal(struct __pyx_obj_6mt
   __pyx_t_1 = __pyx_v_self->lock;
   __Pyx_INCREF(__pyx_t_1);
 
-  /* "mtrand.pyx":3433
+  /* "mtrand.pyx":3439
  *         if np.any(np.signbit(osigma)):
  *             raise ValueError("sigma < 0.0")
  *         return cont2_array(self.internal_state, rk_lognormal, size, omean,             # <<<<<<<<<<<<<<
  *                            osigma, self.lock)
  * 
  */
-  __pyx_t_2 = __pyx_f_6mtrand_cont2_array(__pyx_v_self->internal_state, rk_lognormal, __pyx_v_size, __pyx_v_omean, __pyx_v_osigma, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3433, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_6mtrand_cont2_array(__pyx_v_self->internal_state, rk_lognormal, __pyx_v_size, __pyx_v_omean, __pyx_v_osigma, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3439, __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;
 
-  /* "mtrand.pyx":3312
+  /* "mtrand.pyx":3318
  *                            oscale, self.lock)
  * 
  *     def lognormal(self, mean=0.0, sigma=1.0, size=None):             # <<<<<<<<<<<<<<
@@ -28094,7 +28157,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_74lognormal(struct __pyx_obj_6mt
   return __pyx_r;
 }
 
-/* "mtrand.pyx":3436
+/* "mtrand.pyx":3442
  *                            osigma, self.lock)
  * 
  *     def rayleigh(self, scale=1.0, size=None):             # <<<<<<<<<<<<<<
@@ -28104,7 +28167,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_74lognormal(struct __pyx_obj_6mt
 
 /* Python wrapper */
 static PyObject *__pyx_pw_6mtrand_11RandomState_77rayleigh(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_76rayleigh[] = "\n        rayleigh(scale=1.0, size=None)\n\n        Draw samples from a Rayleigh distribution.\n\n        The :math:`\\chi` and Weibull distributions are generalizations of the\n        Rayleigh.\n\n        Parameters\n        ----------\n        scale : float or array_like of floats, optional\n            Scale, also equals the mode. Should be >= 0. Default is 1.\n        size : int or tuple of ints, optional\n            Output shape.  If the given shape is, e.g., ``(m, n, k)``, then\n            ``m * n * k`` samples are drawn.  If size is ``None`` (default),\n            a single value is returned if ``scale`` is a scalar.  Otherwise,\n            ``np.array(scale).size`` samples are drawn.\n\n        Returns\n        -------\n        out : ndarray or scalar\n            Drawn samples from the parameterized Rayleigh distribution.\n\n        Notes\n        -----\n        The probability density function for the Rayleigh distribution is\n\n        .. math:: P(x;scale) = \\frac{x}{scale^2}e^{\\frac{-x^2}{2 \\cdotp scale^2}}\n\n        The Rayleigh distribution would arise, for example, if the East\n        and North components of the wind velocity had identical zero-mean\n        Gaussian distributions.  Then the wind speed would have a Rayleigh\n        distribution.\n\n        References\n        ----------\n        .. [1] Brighton Webs Ltd., \"Rayleigh Distribution,\"\n               https://web.archive.org/web/20090514091424/http://brighton-webs.co.uk:80/distributions/rayleigh.asp\n        .. [2] Wikipedia, \"Rayleigh distribution\"\n               https://en.wikipedia.org/wiki/Rayleigh_distribution\n\n        Examples\n        --------\n        Draw values from the distribution and plot the histogram\n\n        >>> values = hist(np.random.rayleigh(3, 100000), bins=200, density=True)\n\n        Wave heights tend to follow a Rayleigh distribution. If the mean wave\n        height is 1 meter, what fraction of waves are likely to be larger than 3\n        meters?""\n\n        >>> meanvalue = 1\n        >>> modevalue = np.sqrt(2 / np.pi) * meanvalue\n        >>> s = np.random.rayleigh(modevalue, 1000000)\n\n        The percentage of waves larger than 3 meters is:\n\n        >>> 100.*sum(s>3)/1000000.\n        0.087300000000000003\n\n        ";
+static char __pyx_doc_6mtrand_11RandomState_76rayleigh[] = "\n        rayleigh(scale=1.0, size=None)\n\n        Draw samples from a Rayleigh distribution.\n\n        The :math:`\\chi` and Weibull distributions are generalizations of the\n        Rayleigh.\n\n        Parameters\n        ----------\n        scale : float or array_like of floats, optional\n            Scale, also equals the mode. Should be >= 0. Default is 1.\n        size : int or tuple of ints, optional\n            Output shape.  If the given shape is, e.g., ``(m, n, k)``, then\n            ``m * n * k`` samples are drawn.  If size is ``None`` (default),\n            a single value is returned if ``scale`` is a scalar.  Otherwise,\n            ``np.array(scale).size`` samples are drawn.\n\n        Returns\n        -------\n        out : ndarray or scalar\n            Drawn samples from the parameterized Rayleigh distribution.\n\n        Notes\n        -----\n        The probability density function for the Rayleigh distribution is\n\n        .. math:: P(x;scale) = \\frac{x}{scale^2}e^{\\frac{-x^2}{2 \\cdotp scale^2}}\n\n        The Rayleigh distribution would arise, for example, if the East\n        and North components of the wind velocity had identical zero-mean\n        Gaussian distributions.  Then the wind speed would have a Rayleigh\n        distribution.\n\n        References\n        ----------\n        .. [1] Brighton Webs Ltd., \"Rayleigh Distribution,\"\n               https://web.archive.org/web/20090514091424/http://brighton-webs.co.uk:80/distributions/rayleigh.asp\n        .. [2] Wikipedia, \"Rayleigh distribution\"\n               https://en.wikipedia.org/wiki/Rayleigh_distribution\n\n        Examples\n        --------\n        Draw values from the distribution and plot the histogram\n\n        >>> from matplotlib.pyplot import hist\n        >>> values = hist(np.random.rayleigh(3, 100000), bins=200, density=True)\n\n        Wave heights tend to follow a Rayleigh distribution. If the mean wave\n        height is 1 meter, what fraction of waves ""are likely to be larger than 3\n        meters?\n\n        >>> meanvalue = 1\n        >>> modevalue = np.sqrt(2 / np.pi) * meanvalue\n        >>> s = np.random.rayleigh(modevalue, 1000000)\n\n        The percentage of waves larger than 3 meters is:\n\n        >>> 100.*sum(s>3)/1000000.\n        0.087300000000000003\n\n        ";
 static PyObject *__pyx_pw_6mtrand_11RandomState_77rayleigh(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyObject *__pyx_v_scale = 0;
   PyObject *__pyx_v_size = 0;
@@ -28142,7 +28205,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_77rayleigh(PyObject *__pyx_v_sel
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rayleigh") < 0)) __PYX_ERR(0, 3436, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rayleigh") < 0)) __PYX_ERR(0, 3442, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -28159,7 +28222,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_77rayleigh(PyObject *__pyx_v_sel
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("rayleigh", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3436, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("rayleigh", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3442, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("mtrand.RandomState.rayleigh", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -28186,14 +28249,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_76rayleigh(struct __pyx_obj_6mtr
   PyObject *__pyx_t_7 = NULL;
   __Pyx_RefNannySetupContext("rayleigh", 0);
 
-  /* "mtrand.pyx":3501
+  /* "mtrand.pyx":3508
  *         cdef double fscale
  * 
  *         oscale = <ndarray>PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)             # <<<<<<<<<<<<<<
  * 
  *         if oscale.shape == ():
  */
-  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3501, __pyx_L1_error)
+  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3508, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_2 = __pyx_t_1;
   __Pyx_INCREF(__pyx_t_2);
@@ -28201,44 +28264,44 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_76rayleigh(struct __pyx_obj_6mtr
   __pyx_v_oscale = ((PyArrayObject *)__pyx_t_2);
   __pyx_t_2 = 0;
 
-  /* "mtrand.pyx":3503
+  /* "mtrand.pyx":3510
  *         oscale = <ndarray>PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if oscale.shape == ():             # <<<<<<<<<<<<<<
  *             fscale = PyFloat_AsDouble(scale)
  *             if np.signbit(fscale):
  */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_oscale), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3503, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_oscale), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3510, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3503, __pyx_L1_error)
+  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3510, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 3503, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 3510, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (__pyx_t_3) {
 
-    /* "mtrand.pyx":3504
+    /* "mtrand.pyx":3511
  * 
  *         if oscale.shape == ():
  *             fscale = PyFloat_AsDouble(scale)             # <<<<<<<<<<<<<<
  *             if np.signbit(fscale):
  *                 raise ValueError("scale < 0")
  */
-    __pyx_t_4 = PyFloat_AsDouble(__pyx_v_scale); if (unlikely(__pyx_t_4 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 3504, __pyx_L1_error)
+    __pyx_t_4 = PyFloat_AsDouble(__pyx_v_scale); if (unlikely(__pyx_t_4 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 3511, __pyx_L1_error)
     __pyx_v_fscale = __pyx_t_4;
 
-    /* "mtrand.pyx":3505
+    /* "mtrand.pyx":3512
  *         if oscale.shape == ():
  *             fscale = PyFloat_AsDouble(scale)
  *             if np.signbit(fscale):             # <<<<<<<<<<<<<<
  *                 raise ValueError("scale < 0")
  *             return cont1_array_sc(self.internal_state, rk_rayleigh, size,
  */
-    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3505, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3512, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_signbit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3505, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_signbit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3512, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_fscale); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3505, __pyx_L1_error)
+    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_fscale); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3512, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_t_6 = NULL;
     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
@@ -28253,27 +28316,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_76rayleigh(struct __pyx_obj_6mtr
     __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2);
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3505, __pyx_L1_error)
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3512, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 3505, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 3512, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     if (unlikely(__pyx_t_3)) {
 
-      /* "mtrand.pyx":3506
+      /* "mtrand.pyx":3513
  *             fscale = PyFloat_AsDouble(scale)
  *             if np.signbit(fscale):
  *                 raise ValueError("scale < 0")             # <<<<<<<<<<<<<<
  *             return cont1_array_sc(self.internal_state, rk_rayleigh, size,
  *                                   fscale, self.lock)
  */
-      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3506, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3513, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_Raise(__pyx_t_1, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __PYX_ERR(0, 3506, __pyx_L1_error)
+      __PYX_ERR(0, 3513, __pyx_L1_error)
 
-      /* "mtrand.pyx":3505
+      /* "mtrand.pyx":3512
  *         if oscale.shape == ():
  *             fscale = PyFloat_AsDouble(scale)
  *             if np.signbit(fscale):             # <<<<<<<<<<<<<<
@@ -28282,7 +28345,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_76rayleigh(struct __pyx_obj_6mtr
  */
     }
 
-    /* "mtrand.pyx":3507
+    /* "mtrand.pyx":3514
  *             if np.signbit(fscale):
  *                 raise ValueError("scale < 0")
  *             return cont1_array_sc(self.internal_state, rk_rayleigh, size,             # <<<<<<<<<<<<<<
@@ -28291,7 +28354,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_76rayleigh(struct __pyx_obj_6mtr
  */
     __Pyx_XDECREF(__pyx_r);
 
-    /* "mtrand.pyx":3508
+    /* "mtrand.pyx":3515
  *                 raise ValueError("scale < 0")
  *             return cont1_array_sc(self.internal_state, rk_rayleigh, size,
  *                                   fscale, self.lock)             # <<<<<<<<<<<<<<
@@ -28301,21 +28364,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_76rayleigh(struct __pyx_obj_6mtr
     __pyx_t_1 = __pyx_v_self->lock;
     __Pyx_INCREF(__pyx_t_1);
 
-    /* "mtrand.pyx":3507
+    /* "mtrand.pyx":3514
  *             if np.signbit(fscale):
  *                 raise ValueError("scale < 0")
  *             return cont1_array_sc(self.internal_state, rk_rayleigh, size,             # <<<<<<<<<<<<<<
  *                                   fscale, self.lock)
  * 
  */
-    __pyx_t_5 = __pyx_f_6mtrand_cont1_array_sc(__pyx_v_self->internal_state, rk_rayleigh, __pyx_v_size, __pyx_v_fscale, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3507, __pyx_L1_error)
+    __pyx_t_5 = __pyx_f_6mtrand_cont1_array_sc(__pyx_v_self->internal_state, rk_rayleigh, __pyx_v_size, __pyx_v_fscale, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3514, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __pyx_r = __pyx_t_5;
     __pyx_t_5 = 0;
     goto __pyx_L0;
 
-    /* "mtrand.pyx":3503
+    /* "mtrand.pyx":3510
  *         oscale = <ndarray>PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if oscale.shape == ():             # <<<<<<<<<<<<<<
@@ -28324,21 +28387,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_76rayleigh(struct __pyx_obj_6mtr
  */
   }
 
-  /* "mtrand.pyx":3510
+  /* "mtrand.pyx":3517
  *                                   fscale, self.lock)
  * 
  *         if np.any(np.signbit(oscale)):             # <<<<<<<<<<<<<<
  *             raise ValueError("scale < 0.0")
  *         return cont1_array(self.internal_state, rk_rayleigh, size, oscale,
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3510, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3517, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_any); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3510, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_any); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3517, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3510, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3517, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_signbit); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3510, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_signbit); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3517, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   __pyx_t_6 = NULL;
@@ -28353,7 +28416,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_76rayleigh(struct __pyx_obj_6mtr
   }
   __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_6, ((PyObject *)__pyx_v_oscale)) : __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_v_oscale));
   __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3510, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3517, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   __pyx_t_7 = NULL;
@@ -28369,27 +28432,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_76rayleigh(struct __pyx_obj_6mtr
   __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1);
   __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3510, __pyx_L1_error)
+  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3517, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 3510, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 3517, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   if (unlikely(__pyx_t_3)) {
 
-    /* "mtrand.pyx":3511
+    /* "mtrand.pyx":3518
  * 
  *         if np.any(np.signbit(oscale)):
  *             raise ValueError("scale < 0.0")             # <<<<<<<<<<<<<<
  *         return cont1_array(self.internal_state, rk_rayleigh, size, oscale,
  *                            self.lock)
  */
-    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3511, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3518, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_Raise(__pyx_t_5, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __PYX_ERR(0, 3511, __pyx_L1_error)
+    __PYX_ERR(0, 3518, __pyx_L1_error)
 
-    /* "mtrand.pyx":3510
+    /* "mtrand.pyx":3517
  *                                   fscale, self.lock)
  * 
  *         if np.any(np.signbit(oscale)):             # <<<<<<<<<<<<<<
@@ -28398,7 +28461,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_76rayleigh(struct __pyx_obj_6mtr
  */
   }
 
-  /* "mtrand.pyx":3512
+  /* "mtrand.pyx":3519
  *         if np.any(np.signbit(oscale)):
  *             raise ValueError("scale < 0.0")
  *         return cont1_array(self.internal_state, rk_rayleigh, size, oscale,             # <<<<<<<<<<<<<<
@@ -28407,7 +28470,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_76rayleigh(struct __pyx_obj_6mtr
  */
   __Pyx_XDECREF(__pyx_r);
 
-  /* "mtrand.pyx":3513
+  /* "mtrand.pyx":3520
  *             raise ValueError("scale < 0.0")
  *         return cont1_array(self.internal_state, rk_rayleigh, size, oscale,
  *                            self.lock)             # <<<<<<<<<<<<<<
@@ -28417,21 +28480,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_76rayleigh(struct __pyx_obj_6mtr
   __pyx_t_5 = __pyx_v_self->lock;
   __Pyx_INCREF(__pyx_t_5);
 
-  /* "mtrand.pyx":3512
+  /* "mtrand.pyx":3519
  *         if np.any(np.signbit(oscale)):
  *             raise ValueError("scale < 0.0")
  *         return cont1_array(self.internal_state, rk_rayleigh, size, oscale,             # <<<<<<<<<<<<<<
  *                            self.lock)
  * 
  */
-  __pyx_t_2 = __pyx_f_6mtrand_cont1_array(__pyx_v_self->internal_state, rk_rayleigh, __pyx_v_size, __pyx_v_oscale, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3512, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_6mtrand_cont1_array(__pyx_v_self->internal_state, rk_rayleigh, __pyx_v_size, __pyx_v_oscale, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3519, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   __pyx_r = __pyx_t_2;
   __pyx_t_2 = 0;
   goto __pyx_L0;
 
-  /* "mtrand.pyx":3436
+  /* "mtrand.pyx":3442
  *                            osigma, self.lock)
  * 
  *     def rayleigh(self, scale=1.0, size=None):             # <<<<<<<<<<<<<<
@@ -28455,7 +28518,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_76rayleigh(struct __pyx_obj_6mtr
   return __pyx_r;
 }
 
-/* "mtrand.pyx":3515
+/* "mtrand.pyx":3522
  *                            self.lock)
  * 
  *     def wald(self, mean, scale, size=None):             # <<<<<<<<<<<<<<
@@ -28499,7 +28562,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_79wald(PyObject *__pyx_v_self, P
         case  1:
         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_scale)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("wald", 0, 2, 3, 1); __PYX_ERR(0, 3515, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("wald", 0, 2, 3, 1); __PYX_ERR(0, 3522, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  2:
@@ -28509,7 +28572,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_79wald(PyObject *__pyx_v_self, P
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wald") < 0)) __PYX_ERR(0, 3515, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wald") < 0)) __PYX_ERR(0, 3522, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -28527,7 +28590,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_79wald(PyObject *__pyx_v_self, P
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("wald", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3515, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("wald", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3522, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("mtrand.RandomState.wald", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -28558,75 +28621,75 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_78wald(struct __pyx_obj_6mtrand_
   PyObject *__pyx_t_9 = NULL;
   __Pyx_RefNannySetupContext("wald", 0);
 
-  /* "mtrand.pyx":3581
+  /* "mtrand.pyx":3588
  *         cdef double fmean, fscale
  * 
  *         omean = PyArray_FROM_OTF(mean, NPY_DOUBLE, NPY_ARRAY_ALIGNED)             # <<<<<<<<<<<<<<
  *         oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  */
-  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_mean, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3581, __pyx_L1_error)
+  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_mean, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3588, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6mtrand_ndarray))))) __PYX_ERR(0, 3581, __pyx_L1_error)
+  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6mtrand_ndarray))))) __PYX_ERR(0, 3588, __pyx_L1_error)
   __pyx_v_omean = ((PyArrayObject *)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "mtrand.pyx":3582
+  /* "mtrand.pyx":3589
  * 
  *         omean = PyArray_FROM_OTF(mean, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  *         oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)             # <<<<<<<<<<<<<<
  * 
  *         if omean.shape == oscale.shape == ():
  */
-  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3582, __pyx_L1_error)
+  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3589, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6mtrand_ndarray))))) __PYX_ERR(0, 3582, __pyx_L1_error)
+  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6mtrand_ndarray))))) __PYX_ERR(0, 3589, __pyx_L1_error)
   __pyx_v_oscale = ((PyArrayObject *)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "mtrand.pyx":3584
+  /* "mtrand.pyx":3591
  *         oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if omean.shape == oscale.shape == ():             # <<<<<<<<<<<<<<
  *             fmean = PyFloat_AsDouble(mean)
  *             fscale = PyFloat_AsDouble(scale)
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_omean), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3584, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_omean), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3591, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_oscale), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3584, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_oscale), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3591, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3584, __pyx_L1_error)
+  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3591, __pyx_L1_error)
   if (__Pyx_PyObject_IsTrue(__pyx_t_3)) {
     __Pyx_DECREF(__pyx_t_3);
-    __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3584, __pyx_L1_error)
+    __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3591, __pyx_L1_error)
   }
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3584, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3591, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   if (__pyx_t_4) {
 
-    /* "mtrand.pyx":3585
+    /* "mtrand.pyx":3592
  * 
  *         if omean.shape == oscale.shape == ():
  *             fmean = PyFloat_AsDouble(mean)             # <<<<<<<<<<<<<<
  *             fscale = PyFloat_AsDouble(scale)
  * 
  */
-    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_mean); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 3585, __pyx_L1_error)
+    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_mean); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 3592, __pyx_L1_error)
     __pyx_v_fmean = __pyx_t_5;
 
-    /* "mtrand.pyx":3586
+    /* "mtrand.pyx":3593
  *         if omean.shape == oscale.shape == ():
  *             fmean = PyFloat_AsDouble(mean)
  *             fscale = PyFloat_AsDouble(scale)             # <<<<<<<<<<<<<<
  * 
  *             if fmean <= 0:
  */
-    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_scale); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 3586, __pyx_L1_error)
+    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_scale); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 3593, __pyx_L1_error)
     __pyx_v_fscale = __pyx_t_5;
 
-    /* "mtrand.pyx":3588
+    /* "mtrand.pyx":3595
  *             fscale = PyFloat_AsDouble(scale)
  * 
  *             if fmean <= 0:             # <<<<<<<<<<<<<<
@@ -28636,20 +28699,20 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_78wald(struct __pyx_obj_6mtrand_
     __pyx_t_4 = ((__pyx_v_fmean <= 0.0) != 0);
     if (unlikely(__pyx_t_4)) {
 
-      /* "mtrand.pyx":3589
+      /* "mtrand.pyx":3596
  * 
  *             if fmean <= 0:
  *                 raise ValueError("mean <= 0")             # <<<<<<<<<<<<<<
  *             if fscale <= 0:
  *                 raise ValueError("scale <= 0")
  */
-      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3589, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3596, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __PYX_ERR(0, 3589, __pyx_L1_error)
+      __PYX_ERR(0, 3596, __pyx_L1_error)
 
-      /* "mtrand.pyx":3588
+      /* "mtrand.pyx":3595
  *             fscale = PyFloat_AsDouble(scale)
  * 
  *             if fmean <= 0:             # <<<<<<<<<<<<<<
@@ -28658,7 +28721,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_78wald(struct __pyx_obj_6mtrand_
  */
     }
 
-    /* "mtrand.pyx":3590
+    /* "mtrand.pyx":3597
  *             if fmean <= 0:
  *                 raise ValueError("mean <= 0")
  *             if fscale <= 0:             # <<<<<<<<<<<<<<
@@ -28668,20 +28731,20 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_78wald(struct __pyx_obj_6mtrand_
     __pyx_t_4 = ((__pyx_v_fscale <= 0.0) != 0);
     if (unlikely(__pyx_t_4)) {
 
-      /* "mtrand.pyx":3591
+      /* "mtrand.pyx":3598
  *                 raise ValueError("mean <= 0")
  *             if fscale <= 0:
  *                 raise ValueError("scale <= 0")             # <<<<<<<<<<<<<<
  *             return cont2_array_sc(self.internal_state, rk_wald, size, fmean,
  *                                   fscale, self.lock)
  */
-      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3591, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3598, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __PYX_ERR(0, 3591, __pyx_L1_error)
+      __PYX_ERR(0, 3598, __pyx_L1_error)
 
-      /* "mtrand.pyx":3590
+      /* "mtrand.pyx":3597
  *             if fmean <= 0:
  *                 raise ValueError("mean <= 0")
  *             if fscale <= 0:             # <<<<<<<<<<<<<<
@@ -28690,7 +28753,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_78wald(struct __pyx_obj_6mtrand_
  */
     }
 
-    /* "mtrand.pyx":3592
+    /* "mtrand.pyx":3599
  *             if fscale <= 0:
  *                 raise ValueError("scale <= 0")
  *             return cont2_array_sc(self.internal_state, rk_wald, size, fmean,             # <<<<<<<<<<<<<<
@@ -28699,7 +28762,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_78wald(struct __pyx_obj_6mtrand_
  */
     __Pyx_XDECREF(__pyx_r);
 
-    /* "mtrand.pyx":3593
+    /* "mtrand.pyx":3600
  *                 raise ValueError("scale <= 0")
  *             return cont2_array_sc(self.internal_state, rk_wald, size, fmean,
  *                                   fscale, self.lock)             # <<<<<<<<<<<<<<
@@ -28709,21 +28772,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_78wald(struct __pyx_obj_6mtrand_
     __pyx_t_3 = __pyx_v_self->lock;
     __Pyx_INCREF(__pyx_t_3);
 
-    /* "mtrand.pyx":3592
+    /* "mtrand.pyx":3599
  *             if fscale <= 0:
  *                 raise ValueError("scale <= 0")
  *             return cont2_array_sc(self.internal_state, rk_wald, size, fmean,             # <<<<<<<<<<<<<<
  *                                   fscale, self.lock)
  * 
  */
-    __pyx_t_2 = __pyx_f_6mtrand_cont2_array_sc(__pyx_v_self->internal_state, rk_wald, __pyx_v_size, __pyx_v_fmean, __pyx_v_fscale, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3592, __pyx_L1_error)
+    __pyx_t_2 = __pyx_f_6mtrand_cont2_array_sc(__pyx_v_self->internal_state, rk_wald, __pyx_v_size, __pyx_v_fmean, __pyx_v_fscale, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3599, __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;
 
-    /* "mtrand.pyx":3584
+    /* "mtrand.pyx":3591
  *         oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if omean.shape == oscale.shape == ():             # <<<<<<<<<<<<<<
@@ -28732,21 +28795,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_78wald(struct __pyx_obj_6mtrand_
  */
   }
 
-  /* "mtrand.pyx":3595
+  /* "mtrand.pyx":3602
  *                                   fscale, self.lock)
  * 
  *         if np.any(np.less_equal(omean,0.0)):             # <<<<<<<<<<<<<<
  *             raise ValueError("mean <= 0.0")
  *         elif np.any(np.less_equal(oscale,0.0)):
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3595, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3602, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_any); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3595, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_any); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3602, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3595, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3602, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_less_equal); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3595, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_less_equal); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3602, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   __pyx_t_6 = NULL;
@@ -28764,7 +28827,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_78wald(struct __pyx_obj_6mtrand_
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_7)) {
     PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_v_omean), __pyx_float_0_0};
-    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3595, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3602, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_GOTREF(__pyx_t_3);
   } else
@@ -28772,13 +28835,13 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_78wald(struct __pyx_obj_6mtrand_
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
     PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_v_omean), __pyx_float_0_0};
-    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3595, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3602, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_GOTREF(__pyx_t_3);
   } else
   #endif
   {
-    __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3595, __pyx_L1_error)
+    __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3602, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_9);
     if (__pyx_t_6) {
       __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL;
@@ -28789,7 +28852,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_78wald(struct __pyx_obj_6mtrand_
     __Pyx_INCREF(__pyx_float_0_0);
     __Pyx_GIVEREF(__pyx_float_0_0);
     PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_float_0_0);
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3595, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3602, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
   }
@@ -28807,27 +28870,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_78wald(struct __pyx_obj_6mtrand_
   __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_7, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3);
   __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3595, __pyx_L1_error)
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3602, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3595, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3602, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (unlikely(__pyx_t_4)) {
 
-    /* "mtrand.pyx":3596
+    /* "mtrand.pyx":3603
  * 
  *         if np.any(np.less_equal(omean,0.0)):
  *             raise ValueError("mean <= 0.0")             # <<<<<<<<<<<<<<
  *         elif np.any(np.less_equal(oscale,0.0)):
  *             raise ValueError("scale <= 0.0")
  */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3596, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3603, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __PYX_ERR(0, 3596, __pyx_L1_error)
+    __PYX_ERR(0, 3603, __pyx_L1_error)
 
-    /* "mtrand.pyx":3595
+    /* "mtrand.pyx":3602
  *                                   fscale, self.lock)
  * 
  *         if np.any(np.less_equal(omean,0.0)):             # <<<<<<<<<<<<<<
@@ -28836,21 +28899,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_78wald(struct __pyx_obj_6mtrand_
  */
   }
 
-  /* "mtrand.pyx":3597
+  /* "mtrand.pyx":3604
  *         if np.any(np.less_equal(omean,0.0)):
  *             raise ValueError("mean <= 0.0")
  *         elif np.any(np.less_equal(oscale,0.0)):             # <<<<<<<<<<<<<<
  *             raise ValueError("scale <= 0.0")
  *         return cont2_array(self.internal_state, rk_wald, size, omean, oscale,
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3597, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3604, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_any); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3597, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_any); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3604, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3597, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3604, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_less_equal); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3597, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_less_equal); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3604, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   __pyx_t_7 = NULL;
@@ -28868,7 +28931,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_78wald(struct __pyx_obj_6mtrand_
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_9)) {
     PyObject *__pyx_temp[3] = {__pyx_t_7, ((PyObject *)__pyx_v_oscale), __pyx_float_0_0};
-    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3597, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3604, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
@@ -28876,13 +28939,13 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_78wald(struct __pyx_obj_6mtrand_
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
     PyObject *__pyx_temp[3] = {__pyx_t_7, ((PyObject *)__pyx_v_oscale), __pyx_float_0_0};
-    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3597, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3604, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
   #endif
   {
-    __pyx_t_6 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3597, __pyx_L1_error)
+    __pyx_t_6 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3604, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     if (__pyx_t_7) {
       __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = NULL;
@@ -28893,7 +28956,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_78wald(struct __pyx_obj_6mtrand_
     __Pyx_INCREF(__pyx_float_0_0);
     __Pyx_GIVEREF(__pyx_float_0_0);
     PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_float_0_0);
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3597, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3604, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   }
@@ -28911,27 +28974,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_78wald(struct __pyx_obj_6mtrand_
   __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_9, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1);
   __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3597, __pyx_L1_error)
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3604, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3597, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3604, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (unlikely(__pyx_t_4)) {
 
-    /* "mtrand.pyx":3598
+    /* "mtrand.pyx":3605
  *             raise ValueError("mean <= 0.0")
  *         elif np.any(np.less_equal(oscale,0.0)):
  *             raise ValueError("scale <= 0.0")             # <<<<<<<<<<<<<<
  *         return cont2_array(self.internal_state, rk_wald, size, omean, oscale,
  *                            self.lock)
  */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3598, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3605, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __PYX_ERR(0, 3598, __pyx_L1_error)
+    __PYX_ERR(0, 3605, __pyx_L1_error)
 
-    /* "mtrand.pyx":3597
+    /* "mtrand.pyx":3604
  *         if np.any(np.less_equal(omean,0.0)):
  *             raise ValueError("mean <= 0.0")
  *         elif np.any(np.less_equal(oscale,0.0)):             # <<<<<<<<<<<<<<
@@ -28940,7 +29003,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_78wald(struct __pyx_obj_6mtrand_
  */
   }
 
-  /* "mtrand.pyx":3599
+  /* "mtrand.pyx":3606
  *         elif np.any(np.less_equal(oscale,0.0)):
  *             raise ValueError("scale <= 0.0")
  *         return cont2_array(self.internal_state, rk_wald, size, omean, oscale,             # <<<<<<<<<<<<<<
@@ -28949,7 +29012,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_78wald(struct __pyx_obj_6mtrand_
  */
   __Pyx_XDECREF(__pyx_r);
 
-  /* "mtrand.pyx":3600
+  /* "mtrand.pyx":3607
  *             raise ValueError("scale <= 0.0")
  *         return cont2_array(self.internal_state, rk_wald, size, omean, oscale,
  *                            self.lock)             # <<<<<<<<<<<<<<
@@ -28959,21 +29022,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_78wald(struct __pyx_obj_6mtrand_
   __pyx_t_2 = __pyx_v_self->lock;
   __Pyx_INCREF(__pyx_t_2);
 
-  /* "mtrand.pyx":3599
+  /* "mtrand.pyx":3606
  *         elif np.any(np.less_equal(oscale,0.0)):
  *             raise ValueError("scale <= 0.0")
  *         return cont2_array(self.internal_state, rk_wald, size, omean, oscale,             # <<<<<<<<<<<<<<
  *                            self.lock)
  * 
  */
-  __pyx_t_3 = __pyx_f_6mtrand_cont2_array(__pyx_v_self->internal_state, rk_wald, __pyx_v_size, __pyx_v_omean, __pyx_v_oscale, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3599, __pyx_L1_error)
+  __pyx_t_3 = __pyx_f_6mtrand_cont2_array(__pyx_v_self->internal_state, rk_wald, __pyx_v_size, __pyx_v_omean, __pyx_v_oscale, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3606, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_r = __pyx_t_3;
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  /* "mtrand.pyx":3515
+  /* "mtrand.pyx":3522
  *                            self.lock)
  * 
  *     def wald(self, mean, scale, size=None):             # <<<<<<<<<<<<<<
@@ -28999,7 +29062,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_78wald(struct __pyx_obj_6mtrand_
   return __pyx_r;
 }
 
-/* "mtrand.pyx":3602
+/* "mtrand.pyx":3609
  *                            self.lock)
  * 
  *     def triangular(self, left, mode, right, size=None):             # <<<<<<<<<<<<<<
@@ -29046,13 +29109,13 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_81triangular(PyObject *__pyx_v_s
         case  1:
         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("triangular", 0, 3, 4, 1); __PYX_ERR(0, 3602, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("triangular", 0, 3, 4, 1); __PYX_ERR(0, 3609, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  2:
         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("triangular", 0, 3, 4, 2); __PYX_ERR(0, 3602, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("triangular", 0, 3, 4, 2); __PYX_ERR(0, 3609, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  3:
@@ -29062,7 +29125,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_81triangular(PyObject *__pyx_v_s
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "triangular") < 0)) __PYX_ERR(0, 3602, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "triangular") < 0)) __PYX_ERR(0, 3609, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -29082,7 +29145,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_81triangular(PyObject *__pyx_v_s
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("triangular", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3602, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("triangular", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3609, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("mtrand.RandomState.triangular", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -29115,14 +29178,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_80triangular(struct __pyx_obj_6m
   PyObject *__pyx_t_9 = NULL;
   __Pyx_RefNannySetupContext("triangular", 0);
 
-  /* "mtrand.pyx":3668
+  /* "mtrand.pyx":3675
  *         cdef double fleft, fmode, fright
  * 
  *         oleft = <ndarray>PyArray_FROM_OTF(left, NPY_DOUBLE, NPY_ARRAY_ALIGNED)             # <<<<<<<<<<<<<<
  *         omode = <ndarray>PyArray_FROM_OTF(mode, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  *         oright = <ndarray>PyArray_FROM_OTF(right, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  */
-  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_left, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3668, __pyx_L1_error)
+  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_left, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3675, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_2 = __pyx_t_1;
   __Pyx_INCREF(__pyx_t_2);
@@ -29130,14 +29193,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_80triangular(struct __pyx_obj_6m
   __pyx_v_oleft = ((PyArrayObject *)__pyx_t_2);
   __pyx_t_2 = 0;
 
-  /* "mtrand.pyx":3669
+  /* "mtrand.pyx":3676
  * 
  *         oleft = <ndarray>PyArray_FROM_OTF(left, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  *         omode = <ndarray>PyArray_FROM_OTF(mode, NPY_DOUBLE, NPY_ARRAY_ALIGNED)             # <<<<<<<<<<<<<<
  *         oright = <ndarray>PyArray_FROM_OTF(right, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  */
-  __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_mode, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3669, __pyx_L1_error)
+  __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_mode, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3676, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_1 = __pyx_t_2;
   __Pyx_INCREF(__pyx_t_1);
@@ -29145,14 +29208,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_80triangular(struct __pyx_obj_6m
   __pyx_v_omode = ((PyArrayObject *)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "mtrand.pyx":3670
+  /* "mtrand.pyx":3677
  *         oleft = <ndarray>PyArray_FROM_OTF(left, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  *         omode = <ndarray>PyArray_FROM_OTF(mode, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  *         oright = <ndarray>PyArray_FROM_OTF(right, NPY_DOUBLE, NPY_ARRAY_ALIGNED)             # <<<<<<<<<<<<<<
  * 
  *         if oleft.shape == omode.shape == oright.shape == ():
  */
-  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_right, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3670, __pyx_L1_error)
+  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_right, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3677, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_2 = __pyx_t_1;
   __Pyx_INCREF(__pyx_t_2);
@@ -29160,66 +29223,66 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_80triangular(struct __pyx_obj_6m
   __pyx_v_oright = ((PyArrayObject *)__pyx_t_2);
   __pyx_t_2 = 0;
 
-  /* "mtrand.pyx":3672
+  /* "mtrand.pyx":3679
  *         oright = <ndarray>PyArray_FROM_OTF(right, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if oleft.shape == omode.shape == oright.shape == ():             # <<<<<<<<<<<<<<
  *             fleft = PyFloat_AsDouble(left)
  *             fright = PyFloat_AsDouble(right)
  */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_oleft), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3672, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_oleft), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3679, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_omode), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3672, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_omode), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3679, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3672, __pyx_L1_error)
+  __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3679, __pyx_L1_error)
   if (__Pyx_PyObject_IsTrue(__pyx_t_3)) {
     __Pyx_DECREF(__pyx_t_3);
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_oright), __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3672, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_oright), __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3679, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3672, __pyx_L1_error)
+    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3679, __pyx_L1_error)
     if (__Pyx_PyObject_IsTrue(__pyx_t_3)) {
       __Pyx_DECREF(__pyx_t_3);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3672, __pyx_L1_error)
+      __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3679, __pyx_L1_error)
     }
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   }
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 3672, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 3679, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   if (__pyx_t_5) {
 
-    /* "mtrand.pyx":3673
+    /* "mtrand.pyx":3680
  * 
  *         if oleft.shape == omode.shape == oright.shape == ():
  *             fleft = PyFloat_AsDouble(left)             # <<<<<<<<<<<<<<
  *             fright = PyFloat_AsDouble(right)
  *             fmode = PyFloat_AsDouble(mode)
  */
-    __pyx_t_6 = PyFloat_AsDouble(__pyx_v_left); if (unlikely(__pyx_t_6 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 3673, __pyx_L1_error)
+    __pyx_t_6 = PyFloat_AsDouble(__pyx_v_left); if (unlikely(__pyx_t_6 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 3680, __pyx_L1_error)
     __pyx_v_fleft = __pyx_t_6;
 
-    /* "mtrand.pyx":3674
+    /* "mtrand.pyx":3681
  *         if oleft.shape == omode.shape == oright.shape == ():
  *             fleft = PyFloat_AsDouble(left)
  *             fright = PyFloat_AsDouble(right)             # <<<<<<<<<<<<<<
  *             fmode = PyFloat_AsDouble(mode)
  * 
  */
-    __pyx_t_6 = PyFloat_AsDouble(__pyx_v_right); if (unlikely(__pyx_t_6 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 3674, __pyx_L1_error)
+    __pyx_t_6 = PyFloat_AsDouble(__pyx_v_right); if (unlikely(__pyx_t_6 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 3681, __pyx_L1_error)
     __pyx_v_fright = __pyx_t_6;
 
-    /* "mtrand.pyx":3675
+    /* "mtrand.pyx":3682
  *             fleft = PyFloat_AsDouble(left)
  *             fright = PyFloat_AsDouble(right)
  *             fmode = PyFloat_AsDouble(mode)             # <<<<<<<<<<<<<<
  * 
  *             if fleft > fmode:
  */
-    __pyx_t_6 = PyFloat_AsDouble(__pyx_v_mode); if (unlikely(__pyx_t_6 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 3675, __pyx_L1_error)
+    __pyx_t_6 = PyFloat_AsDouble(__pyx_v_mode); if (unlikely(__pyx_t_6 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 3682, __pyx_L1_error)
     __pyx_v_fmode = __pyx_t_6;
 
-    /* "mtrand.pyx":3677
+    /* "mtrand.pyx":3684
  *             fmode = PyFloat_AsDouble(mode)
  * 
  *             if fleft > fmode:             # <<<<<<<<<<<<<<
@@ -29229,20 +29292,20 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_80triangular(struct __pyx_obj_6m
     __pyx_t_5 = ((__pyx_v_fleft > __pyx_v_fmode) != 0);
     if (unlikely(__pyx_t_5)) {
 
-      /* "mtrand.pyx":3678
+      /* "mtrand.pyx":3685
  * 
  *             if fleft > fmode:
  *                 raise ValueError("left > mode")             # <<<<<<<<<<<<<<
  *             if fmode > fright:
  *                 raise ValueError("mode > right")
  */
-      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3678, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3685, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __PYX_ERR(0, 3678, __pyx_L1_error)
+      __PYX_ERR(0, 3685, __pyx_L1_error)
 
-      /* "mtrand.pyx":3677
+      /* "mtrand.pyx":3684
  *             fmode = PyFloat_AsDouble(mode)
  * 
  *             if fleft > fmode:             # <<<<<<<<<<<<<<
@@ -29251,7 +29314,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_80triangular(struct __pyx_obj_6m
  */
     }
 
-    /* "mtrand.pyx":3679
+    /* "mtrand.pyx":3686
  *             if fleft > fmode:
  *                 raise ValueError("left > mode")
  *             if fmode > fright:             # <<<<<<<<<<<<<<
@@ -29261,20 +29324,20 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_80triangular(struct __pyx_obj_6m
     __pyx_t_5 = ((__pyx_v_fmode > __pyx_v_fright) != 0);
     if (unlikely(__pyx_t_5)) {
 
-      /* "mtrand.pyx":3680
+      /* "mtrand.pyx":3687
  *                 raise ValueError("left > mode")
  *             if fmode > fright:
  *                 raise ValueError("mode > right")             # <<<<<<<<<<<<<<
  *             if fleft == fright:
  *                 raise ValueError("left == right")
  */
-      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3680, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3687, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __PYX_ERR(0, 3680, __pyx_L1_error)
+      __PYX_ERR(0, 3687, __pyx_L1_error)
 
-      /* "mtrand.pyx":3679
+      /* "mtrand.pyx":3686
  *             if fleft > fmode:
  *                 raise ValueError("left > mode")
  *             if fmode > fright:             # <<<<<<<<<<<<<<
@@ -29283,7 +29346,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_80triangular(struct __pyx_obj_6m
  */
     }
 
-    /* "mtrand.pyx":3681
+    /* "mtrand.pyx":3688
  *             if fmode > fright:
  *                 raise ValueError("mode > right")
  *             if fleft == fright:             # <<<<<<<<<<<<<<
@@ -29293,20 +29356,20 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_80triangular(struct __pyx_obj_6m
     __pyx_t_5 = ((__pyx_v_fleft == __pyx_v_fright) != 0);
     if (unlikely(__pyx_t_5)) {
 
-      /* "mtrand.pyx":3682
+      /* "mtrand.pyx":3689
  *                 raise ValueError("mode > right")
  *             if fleft == fright:
  *                 raise ValueError("left == right")             # <<<<<<<<<<<<<<
  *             return cont3_array_sc(self.internal_state, rk_triangular, size,
  *                                   fleft, fmode, fright, self.lock)
  */
-      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3682, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3689, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __PYX_ERR(0, 3682, __pyx_L1_error)
+      __PYX_ERR(0, 3689, __pyx_L1_error)
 
-      /* "mtrand.pyx":3681
+      /* "mtrand.pyx":3688
  *             if fmode > fright:
  *                 raise ValueError("mode > right")
  *             if fleft == fright:             # <<<<<<<<<<<<<<
@@ -29315,7 +29378,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_80triangular(struct __pyx_obj_6m
  */
     }
 
-    /* "mtrand.pyx":3683
+    /* "mtrand.pyx":3690
  *             if fleft == fright:
  *                 raise ValueError("left == right")
  *             return cont3_array_sc(self.internal_state, rk_triangular, size,             # <<<<<<<<<<<<<<
@@ -29324,7 +29387,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_80triangular(struct __pyx_obj_6m
  */
     __Pyx_XDECREF(__pyx_r);
 
-    /* "mtrand.pyx":3684
+    /* "mtrand.pyx":3691
  *                 raise ValueError("left == right")
  *             return cont3_array_sc(self.internal_state, rk_triangular, size,
  *                                   fleft, fmode, fright, self.lock)             # <<<<<<<<<<<<<<
@@ -29334,21 +29397,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_80triangular(struct __pyx_obj_6m
     __pyx_t_3 = __pyx_v_self->lock;
     __Pyx_INCREF(__pyx_t_3);
 
-    /* "mtrand.pyx":3683
+    /* "mtrand.pyx":3690
  *             if fleft == fright:
  *                 raise ValueError("left == right")
  *             return cont3_array_sc(self.internal_state, rk_triangular, size,             # <<<<<<<<<<<<<<
  *                                   fleft, fmode, fright, self.lock)
  * 
  */
-    __pyx_t_1 = __pyx_f_6mtrand_cont3_array_sc(__pyx_v_self->internal_state, rk_triangular, __pyx_v_size, __pyx_v_fleft, __pyx_v_fmode, __pyx_v_fright, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3683, __pyx_L1_error)
+    __pyx_t_1 = __pyx_f_6mtrand_cont3_array_sc(__pyx_v_self->internal_state, rk_triangular, __pyx_v_size, __pyx_v_fleft, __pyx_v_fmode, __pyx_v_fright, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3690, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __pyx_r = __pyx_t_1;
     __pyx_t_1 = 0;
     goto __pyx_L0;
 
-    /* "mtrand.pyx":3672
+    /* "mtrand.pyx":3679
  *         oright = <ndarray>PyArray_FROM_OTF(right, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if oleft.shape == omode.shape == oright.shape == ():             # <<<<<<<<<<<<<<
@@ -29357,21 +29420,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_80triangular(struct __pyx_obj_6m
  */
   }
 
-  /* "mtrand.pyx":3686
+  /* "mtrand.pyx":3693
  *                                   fleft, fmode, fright, self.lock)
  * 
  *         if np.any(np.greater(oleft, omode)):             # <<<<<<<<<<<<<<
  *             raise ValueError("left > mode")
  *         if np.any(np.greater(omode, oright)):
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3686, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3693, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_any); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3686, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_any); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3693, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3686, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3693, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_greater); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3686, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_greater); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3693, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   __pyx_t_4 = NULL;
@@ -29389,7 +29452,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_80triangular(struct __pyx_obj_6m
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_7)) {
     PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_oleft), ((PyObject *)__pyx_v_omode)};
-    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3686, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3693, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_GOTREF(__pyx_t_3);
   } else
@@ -29397,13 +29460,13 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_80triangular(struct __pyx_obj_6m
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
     PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_oleft), ((PyObject *)__pyx_v_omode)};
-    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3686, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3693, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_GOTREF(__pyx_t_3);
   } else
   #endif
   {
-    __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3686, __pyx_L1_error)
+    __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3693, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_9);
     if (__pyx_t_4) {
       __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); __pyx_t_4 = NULL;
@@ -29414,7 +29477,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_80triangular(struct __pyx_obj_6m
     __Pyx_INCREF(((PyObject *)__pyx_v_omode));
     __Pyx_GIVEREF(((PyObject *)__pyx_v_omode));
     PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, ((PyObject *)__pyx_v_omode));
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3686, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3693, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
   }
@@ -29432,27 +29495,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_80triangular(struct __pyx_obj_6m
   __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
   __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3686, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3693, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 3686, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 3693, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (unlikely(__pyx_t_5)) {
 
-    /* "mtrand.pyx":3687
+    /* "mtrand.pyx":3694
  * 
  *         if np.any(np.greater(oleft, omode)):
  *             raise ValueError("left > mode")             # <<<<<<<<<<<<<<
  *         if np.any(np.greater(omode, oright)):
  *             raise ValueError("mode > right")
  */
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3687, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3694, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __PYX_ERR(0, 3687, __pyx_L1_error)
+    __PYX_ERR(0, 3694, __pyx_L1_error)
 
-    /* "mtrand.pyx":3686
+    /* "mtrand.pyx":3693
  *                                   fleft, fmode, fright, self.lock)
  * 
  *         if np.any(np.greater(oleft, omode)):             # <<<<<<<<<<<<<<
@@ -29461,21 +29524,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_80triangular(struct __pyx_obj_6m
  */
   }
 
-  /* "mtrand.pyx":3688
+  /* "mtrand.pyx":3695
  *         if np.any(np.greater(oleft, omode)):
  *             raise ValueError("left > mode")
  *         if np.any(np.greater(omode, oright)):             # <<<<<<<<<<<<<<
  *             raise ValueError("mode > right")
  *         if np.any(np.equal(oleft, oright)):
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3688, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3695, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_any); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3688, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_any); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3695, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3688, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3695, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_greater); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3688, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_greater); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3695, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   __pyx_t_7 = NULL;
@@ -29493,7 +29556,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_80triangular(struct __pyx_obj_6m
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_9)) {
     PyObject *__pyx_temp[3] = {__pyx_t_7, ((PyObject *)__pyx_v_omode), ((PyObject *)__pyx_v_oright)};
-    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3688, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3695, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
     __Pyx_GOTREF(__pyx_t_2);
   } else
@@ -29501,13 +29564,13 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_80triangular(struct __pyx_obj_6m
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
     PyObject *__pyx_temp[3] = {__pyx_t_7, ((PyObject *)__pyx_v_omode), ((PyObject *)__pyx_v_oright)};
-    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3688, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3695, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
     __Pyx_GOTREF(__pyx_t_2);
   } else
   #endif
   {
-    __pyx_t_4 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3688, __pyx_L1_error)
+    __pyx_t_4 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3695, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     if (__pyx_t_7) {
       __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7); __pyx_t_7 = NULL;
@@ -29518,7 +29581,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_80triangular(struct __pyx_obj_6m
     __Pyx_INCREF(((PyObject *)__pyx_v_oright));
     __Pyx_GIVEREF(((PyObject *)__pyx_v_oright));
     PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_8, ((PyObject *)__pyx_v_oright));
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3688, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3695, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   }
@@ -29536,27 +29599,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_80triangular(struct __pyx_obj_6m
   __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_9, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
   __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3688, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3695, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 3688, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 3695, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (unlikely(__pyx_t_5)) {
 
-    /* "mtrand.pyx":3689
+    /* "mtrand.pyx":3696
  *             raise ValueError("left > mode")
  *         if np.any(np.greater(omode, oright)):
  *             raise ValueError("mode > right")             # <<<<<<<<<<<<<<
  *         if np.any(np.equal(oleft, oright)):
  *             raise ValueError("left == right")
  */
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3689, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3696, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __PYX_ERR(0, 3689, __pyx_L1_error)
+    __PYX_ERR(0, 3696, __pyx_L1_error)
 
-    /* "mtrand.pyx":3688
+    /* "mtrand.pyx":3695
  *         if np.any(np.greater(oleft, omode)):
  *             raise ValueError("left > mode")
  *         if np.any(np.greater(omode, oright)):             # <<<<<<<<<<<<<<
@@ -29565,21 +29628,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_80triangular(struct __pyx_obj_6m
  */
   }
 
-  /* "mtrand.pyx":3690
+  /* "mtrand.pyx":3697
  *         if np.any(np.greater(omode, oright)):
  *             raise ValueError("mode > right")
  *         if np.any(np.equal(oleft, oright)):             # <<<<<<<<<<<<<<
  *             raise ValueError("left == right")
  *         return cont3_array(self.internal_state, rk_triangular, size, oleft,
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3690, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3697, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_any); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3690, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_any); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3697, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3690, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3697, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_equal); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3690, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_equal); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3697, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
   __pyx_t_9 = NULL;
@@ -29597,7 +29660,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_80triangular(struct __pyx_obj_6m
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_4)) {
     PyObject *__pyx_temp[3] = {__pyx_t_9, ((PyObject *)__pyx_v_oleft), ((PyObject *)__pyx_v_oright)};
-    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3690, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3697, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
     __Pyx_GOTREF(__pyx_t_3);
   } else
@@ -29605,13 +29668,13 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_80triangular(struct __pyx_obj_6m
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
     PyObject *__pyx_temp[3] = {__pyx_t_9, ((PyObject *)__pyx_v_oleft), ((PyObject *)__pyx_v_oright)};
-    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3690, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3697, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
     __Pyx_GOTREF(__pyx_t_3);
   } else
   #endif
   {
-    __pyx_t_7 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3690, __pyx_L1_error)
+    __pyx_t_7 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3697, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_7);
     if (__pyx_t_9) {
       __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9); __pyx_t_9 = NULL;
@@ -29622,7 +29685,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_80triangular(struct __pyx_obj_6m
     __Pyx_INCREF(((PyObject *)__pyx_v_oright));
     __Pyx_GIVEREF(((PyObject *)__pyx_v_oright));
     PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, ((PyObject *)__pyx_v_oright));
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3690, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3697, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   }
@@ -29640,27 +29703,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_80triangular(struct __pyx_obj_6m
   __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3690, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3697, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 3690, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 3697, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (unlikely(__pyx_t_5)) {
 
-    /* "mtrand.pyx":3691
+    /* "mtrand.pyx":3698
  *             raise ValueError("mode > right")
  *         if np.any(np.equal(oleft, oright)):
  *             raise ValueError("left == right")             # <<<<<<<<<<<<<<
  *         return cont3_array(self.internal_state, rk_triangular, size, oleft,
  *                            omode, oright, self.lock)
  */
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3691, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3698, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __PYX_ERR(0, 3691, __pyx_L1_error)
+    __PYX_ERR(0, 3698, __pyx_L1_error)
 
-    /* "mtrand.pyx":3690
+    /* "mtrand.pyx":3697
  *         if np.any(np.greater(omode, oright)):
  *             raise ValueError("mode > right")
  *         if np.any(np.equal(oleft, oright)):             # <<<<<<<<<<<<<<
@@ -29669,7 +29732,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_80triangular(struct __pyx_obj_6m
  */
   }
 
-  /* "mtrand.pyx":3692
+  /* "mtrand.pyx":3699
  *         if np.any(np.equal(oleft, oright)):
  *             raise ValueError("left == right")
  *         return cont3_array(self.internal_state, rk_triangular, size, oleft,             # <<<<<<<<<<<<<<
@@ -29678,7 +29741,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_80triangular(struct __pyx_obj_6m
  */
   __Pyx_XDECREF(__pyx_r);
 
-  /* "mtrand.pyx":3693
+  /* "mtrand.pyx":3700
  *             raise ValueError("left == right")
  *         return cont3_array(self.internal_state, rk_triangular, size, oleft,
  *                            omode, oright, self.lock)             # <<<<<<<<<<<<<<
@@ -29688,21 +29751,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_80triangular(struct __pyx_obj_6m
   __pyx_t_1 = __pyx_v_self->lock;
   __Pyx_INCREF(__pyx_t_1);
 
-  /* "mtrand.pyx":3692
+  /* "mtrand.pyx":3699
  *         if np.any(np.equal(oleft, oright)):
  *             raise ValueError("left == right")
  *         return cont3_array(self.internal_state, rk_triangular, size, oleft,             # <<<<<<<<<<<<<<
  *                            omode, oright, self.lock)
  * 
  */
-  __pyx_t_2 = __pyx_f_6mtrand_cont3_array(__pyx_v_self->internal_state, rk_triangular, __pyx_v_size, __pyx_v_oleft, __pyx_v_omode, __pyx_v_oright, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3692, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_6mtrand_cont3_array(__pyx_v_self->internal_state, rk_triangular, __pyx_v_size, __pyx_v_oleft, __pyx_v_omode, __pyx_v_oright, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3699, __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;
 
-  /* "mtrand.pyx":3602
+  /* "mtrand.pyx":3609
  *                            self.lock)
  * 
  *     def triangular(self, left, mode, right, size=None):             # <<<<<<<<<<<<<<
@@ -29729,7 +29792,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_80triangular(struct __pyx_obj_6m
   return __pyx_r;
 }
 
-/* "mtrand.pyx":3696
+/* "mtrand.pyx":3703
  * 
  *     # Complicated, discrete distributions:
  *     def binomial(self, n, p, size=None):             # <<<<<<<<<<<<<<
@@ -29773,7 +29836,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_83binomial(PyObject *__pyx_v_sel
         case  1:
         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("binomial", 0, 2, 3, 1); __PYX_ERR(0, 3696, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("binomial", 0, 2, 3, 1); __PYX_ERR(0, 3703, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  2:
@@ -29783,7 +29846,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_83binomial(PyObject *__pyx_v_sel
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "binomial") < 0)) __PYX_ERR(0, 3696, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "binomial") < 0)) __PYX_ERR(0, 3703, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -29801,7 +29864,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_83binomial(PyObject *__pyx_v_sel
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("binomial", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3696, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("binomial", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3703, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("mtrand.RandomState.binomial", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -29833,14 +29896,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_82binomial(struct __pyx_obj_6mtr
   PyObject *__pyx_t_10 = NULL;
   __Pyx_RefNannySetupContext("binomial", 0);
 
-  /* "mtrand.pyx":3785
+  /* "mtrand.pyx":3792
  *         cdef double fp
  * 
  *         on = <ndarray>PyArray_FROM_OTF(n, NPY_LONG, NPY_ARRAY_ALIGNED)             # <<<<<<<<<<<<<<
  *         op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  */
-  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_n, NPY_LONG, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3785, __pyx_L1_error)
+  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_n, NPY_LONG, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3792, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_2 = __pyx_t_1;
   __Pyx_INCREF(__pyx_t_2);
@@ -29848,14 +29911,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_82binomial(struct __pyx_obj_6mtr
   __pyx_v_on = ((PyArrayObject *)__pyx_t_2);
   __pyx_t_2 = 0;
 
-  /* "mtrand.pyx":3786
+  /* "mtrand.pyx":3793
  * 
  *         on = <ndarray>PyArray_FROM_OTF(n, NPY_LONG, NPY_ARRAY_ALIGNED)
  *         op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ARRAY_ALIGNED)             # <<<<<<<<<<<<<<
  * 
  *         if on.shape == op.shape == ():
  */
-  __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_p, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3786, __pyx_L1_error)
+  __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_p, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3793, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_1 = __pyx_t_2;
   __Pyx_INCREF(__pyx_t_1);
@@ -29863,49 +29926,49 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_82binomial(struct __pyx_obj_6mtr
   __pyx_v_op = ((PyArrayObject *)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "mtrand.pyx":3788
+  /* "mtrand.pyx":3795
  *         op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if on.shape == op.shape == ():             # <<<<<<<<<<<<<<
  *             fp = PyFloat_AsDouble(p)
  *             ln = PyInt_AsLong(n)
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_on), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3788, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_on), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3795, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_op), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3788, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_op), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3795, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3788, __pyx_L1_error)
+  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3795, __pyx_L1_error)
   if (__Pyx_PyObject_IsTrue(__pyx_t_3)) {
     __Pyx_DECREF(__pyx_t_3);
-    __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3788, __pyx_L1_error)
+    __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3795, __pyx_L1_error)
   }
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3788, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3795, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   if (__pyx_t_4) {
 
-    /* "mtrand.pyx":3789
+    /* "mtrand.pyx":3796
  * 
  *         if on.shape == op.shape == ():
  *             fp = PyFloat_AsDouble(p)             # <<<<<<<<<<<<<<
  *             ln = PyInt_AsLong(n)
  * 
  */
-    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_p); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 3789, __pyx_L1_error)
+    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_p); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 3796, __pyx_L1_error)
     __pyx_v_fp = __pyx_t_5;
 
-    /* "mtrand.pyx":3790
+    /* "mtrand.pyx":3797
  *         if on.shape == op.shape == ():
  *             fp = PyFloat_AsDouble(p)
  *             ln = PyInt_AsLong(n)             # <<<<<<<<<<<<<<
  * 
  *             if ln < 0:
  */
-    __pyx_t_6 = PyInt_AsLong(__pyx_v_n); if (unlikely(__pyx_t_6 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(0, 3790, __pyx_L1_error)
+    __pyx_t_6 = PyInt_AsLong(__pyx_v_n); if (unlikely(__pyx_t_6 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(0, 3797, __pyx_L1_error)
     __pyx_v_ln = __pyx_t_6;
 
-    /* "mtrand.pyx":3792
+    /* "mtrand.pyx":3799
  *             ln = PyInt_AsLong(n)
  * 
  *             if ln < 0:             # <<<<<<<<<<<<<<
@@ -29915,20 +29978,20 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_82binomial(struct __pyx_obj_6mtr
     __pyx_t_4 = ((__pyx_v_ln < 0) != 0);
     if (unlikely(__pyx_t_4)) {
 
-      /* "mtrand.pyx":3793
+      /* "mtrand.pyx":3800
  * 
  *             if ln < 0:
  *                 raise ValueError("n < 0")             # <<<<<<<<<<<<<<
  *             if fp < 0:
  *                 raise ValueError("p < 0")
  */
-      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3793, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3800, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __PYX_ERR(0, 3793, __pyx_L1_error)
+      __PYX_ERR(0, 3800, __pyx_L1_error)
 
-      /* "mtrand.pyx":3792
+      /* "mtrand.pyx":3799
  *             ln = PyInt_AsLong(n)
  * 
  *             if ln < 0:             # <<<<<<<<<<<<<<
@@ -29937,7 +30000,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_82binomial(struct __pyx_obj_6mtr
  */
     }
 
-    /* "mtrand.pyx":3794
+    /* "mtrand.pyx":3801
  *             if ln < 0:
  *                 raise ValueError("n < 0")
  *             if fp < 0:             # <<<<<<<<<<<<<<
@@ -29947,20 +30010,20 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_82binomial(struct __pyx_obj_6mtr
     __pyx_t_4 = ((__pyx_v_fp < 0.0) != 0);
     if (unlikely(__pyx_t_4)) {
 
-      /* "mtrand.pyx":3795
+      /* "mtrand.pyx":3802
  *                 raise ValueError("n < 0")
  *             if fp < 0:
  *                 raise ValueError("p < 0")             # <<<<<<<<<<<<<<
  *             elif fp > 1:
  *                 raise ValueError("p > 1")
  */
-      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3795, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3802, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __PYX_ERR(0, 3795, __pyx_L1_error)
+      __PYX_ERR(0, 3802, __pyx_L1_error)
 
-      /* "mtrand.pyx":3794
+      /* "mtrand.pyx":3801
  *             if ln < 0:
  *                 raise ValueError("n < 0")
  *             if fp < 0:             # <<<<<<<<<<<<<<
@@ -29969,7 +30032,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_82binomial(struct __pyx_obj_6mtr
  */
     }
 
-    /* "mtrand.pyx":3796
+    /* "mtrand.pyx":3803
  *             if fp < 0:
  *                 raise ValueError("p < 0")
  *             elif fp > 1:             # <<<<<<<<<<<<<<
@@ -29979,20 +30042,20 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_82binomial(struct __pyx_obj_6mtr
     __pyx_t_4 = ((__pyx_v_fp > 1.0) != 0);
     if (unlikely(__pyx_t_4)) {
 
-      /* "mtrand.pyx":3797
+      /* "mtrand.pyx":3804
  *                 raise ValueError("p < 0")
  *             elif fp > 1:
  *                 raise ValueError("p > 1")             # <<<<<<<<<<<<<<
  *             elif np.isnan(fp):
  *                 raise ValueError("p is nan")
  */
-      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3797, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3804, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __PYX_ERR(0, 3797, __pyx_L1_error)
+      __PYX_ERR(0, 3804, __pyx_L1_error)
 
-      /* "mtrand.pyx":3796
+      /* "mtrand.pyx":3803
  *             if fp < 0:
  *                 raise ValueError("p < 0")
  *             elif fp > 1:             # <<<<<<<<<<<<<<
@@ -30001,19 +30064,19 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_82binomial(struct __pyx_obj_6mtr
  */
     }
 
-    /* "mtrand.pyx":3798
+    /* "mtrand.pyx":3805
  *             elif fp > 1:
  *                 raise ValueError("p > 1")
  *             elif np.isnan(fp):             # <<<<<<<<<<<<<<
  *                 raise ValueError("p is nan")
  *             return discnp_array_sc(self.internal_state, rk_binomial, size, ln,
  */
-    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3798, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3805, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_isnan); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3798, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_isnan); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3805, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_fp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3798, __pyx_L1_error)
+    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_fp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3805, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_t_7 = NULL;
     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
@@ -30028,27 +30091,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_82binomial(struct __pyx_obj_6mtr
     __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_7, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2);
     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3798, __pyx_L1_error)
+    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3805, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3798, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3805, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     if (unlikely(__pyx_t_4)) {
 
-      /* "mtrand.pyx":3799
+      /* "mtrand.pyx":3806
  *                 raise ValueError("p > 1")
  *             elif np.isnan(fp):
  *                 raise ValueError("p is nan")             # <<<<<<<<<<<<<<
  *             return discnp_array_sc(self.internal_state, rk_binomial, size, ln,
  *                                    fp, self.lock)
  */
-      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3799, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3806, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __PYX_ERR(0, 3799, __pyx_L1_error)
+      __PYX_ERR(0, 3806, __pyx_L1_error)
 
-      /* "mtrand.pyx":3798
+      /* "mtrand.pyx":3805
  *             elif fp > 1:
  *                 raise ValueError("p > 1")
  *             elif np.isnan(fp):             # <<<<<<<<<<<<<<
@@ -30057,7 +30120,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_82binomial(struct __pyx_obj_6mtr
  */
     }
 
-    /* "mtrand.pyx":3800
+    /* "mtrand.pyx":3807
  *             elif np.isnan(fp):
  *                 raise ValueError("p is nan")
  *             return discnp_array_sc(self.internal_state, rk_binomial, size, ln,             # <<<<<<<<<<<<<<
@@ -30066,7 +30129,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_82binomial(struct __pyx_obj_6mtr
  */
     __Pyx_XDECREF(__pyx_r);
 
-    /* "mtrand.pyx":3801
+    /* "mtrand.pyx":3808
  *                 raise ValueError("p is nan")
  *             return discnp_array_sc(self.internal_state, rk_binomial, size, ln,
  *                                    fp, self.lock)             # <<<<<<<<<<<<<<
@@ -30076,21 +30139,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_82binomial(struct __pyx_obj_6mtr
     __pyx_t_3 = __pyx_v_self->lock;
     __Pyx_INCREF(__pyx_t_3);
 
-    /* "mtrand.pyx":3800
+    /* "mtrand.pyx":3807
  *             elif np.isnan(fp):
  *                 raise ValueError("p is nan")
  *             return discnp_array_sc(self.internal_state, rk_binomial, size, ln,             # <<<<<<<<<<<<<<
  *                                    fp, self.lock)
  * 
  */
-    __pyx_t_1 = __pyx_f_6mtrand_discnp_array_sc(__pyx_v_self->internal_state, rk_binomial, __pyx_v_size, __pyx_v_ln, __pyx_v_fp, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3800, __pyx_L1_error)
+    __pyx_t_1 = __pyx_f_6mtrand_discnp_array_sc(__pyx_v_self->internal_state, rk_binomial, __pyx_v_size, __pyx_v_ln, __pyx_v_fp, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3807, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __pyx_r = __pyx_t_1;
     __pyx_t_1 = 0;
     goto __pyx_L0;
 
-    /* "mtrand.pyx":3788
+    /* "mtrand.pyx":3795
  *         op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if on.shape == op.shape == ():             # <<<<<<<<<<<<<<
@@ -30099,21 +30162,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_82binomial(struct __pyx_obj_6mtr
  */
   }
 
-  /* "mtrand.pyx":3803
+  /* "mtrand.pyx":3810
  *                                    fp, self.lock)
  * 
  *         if np.any(np.less(n, 0)):             # <<<<<<<<<<<<<<
  *             raise ValueError("n < 0")
  *         if np.any(np.less(p, 0)):
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3803, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3810, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_any); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3803, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_any); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3810, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3803, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3810, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_less); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3803, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_less); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3810, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   __pyx_t_7 = NULL;
@@ -30131,7 +30194,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_82binomial(struct __pyx_obj_6mtr
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_8)) {
     PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_n, __pyx_int_0};
-    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3803, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3810, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
     __Pyx_GOTREF(__pyx_t_3);
   } else
@@ -30139,13 +30202,13 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_82binomial(struct __pyx_obj_6mtr
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
     PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_n, __pyx_int_0};
-    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3803, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3810, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
     __Pyx_GOTREF(__pyx_t_3);
   } else
   #endif
   {
-    __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3803, __pyx_L1_error)
+    __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3810, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_10);
     if (__pyx_t_7) {
       __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_7); __pyx_t_7 = NULL;
@@ -30156,7 +30219,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_82binomial(struct __pyx_obj_6mtr
     __Pyx_INCREF(__pyx_int_0);
     __Pyx_GIVEREF(__pyx_int_0);
     PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_int_0);
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3803, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3810, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
   }
@@ -30174,27 +30237,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_82binomial(struct __pyx_obj_6mtr
   __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_8, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
   __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3803, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3810, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3803, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3810, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (unlikely(__pyx_t_4)) {
 
-    /* "mtrand.pyx":3804
+    /* "mtrand.pyx":3811
  * 
  *         if np.any(np.less(n, 0)):
  *             raise ValueError("n < 0")             # <<<<<<<<<<<<<<
  *         if np.any(np.less(p, 0)):
  *             raise ValueError("p < 0")
  */
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3804, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3811, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __PYX_ERR(0, 3804, __pyx_L1_error)
+    __PYX_ERR(0, 3811, __pyx_L1_error)
 
-    /* "mtrand.pyx":3803
+    /* "mtrand.pyx":3810
  *                                    fp, self.lock)
  * 
  *         if np.any(np.less(n, 0)):             # <<<<<<<<<<<<<<
@@ -30203,21 +30266,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_82binomial(struct __pyx_obj_6mtr
  */
   }
 
-  /* "mtrand.pyx":3805
+  /* "mtrand.pyx":3812
  *         if np.any(np.less(n, 0)):
  *             raise ValueError("n < 0")
  *         if np.any(np.less(p, 0)):             # <<<<<<<<<<<<<<
  *             raise ValueError("p < 0")
  *         if np.any(np.greater(p, 1)):
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3805, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3812, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_any); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3805, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_any); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3812, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3805, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3812, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_less); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3805, __pyx_L1_error)
+  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_less); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3812, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_10);
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   __pyx_t_8 = NULL;
@@ -30235,7 +30298,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_82binomial(struct __pyx_obj_6mtr
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_10)) {
     PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_v_p, __pyx_int_0};
-    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3805, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3812, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
     __Pyx_GOTREF(__pyx_t_2);
   } else
@@ -30243,13 +30306,13 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_82binomial(struct __pyx_obj_6mtr
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
     PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_v_p, __pyx_int_0};
-    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3805, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3812, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
     __Pyx_GOTREF(__pyx_t_2);
   } else
   #endif
   {
-    __pyx_t_7 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3805, __pyx_L1_error)
+    __pyx_t_7 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3812, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_7);
     if (__pyx_t_8) {
       __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); __pyx_t_8 = NULL;
@@ -30260,7 +30323,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_82binomial(struct __pyx_obj_6mtr
     __Pyx_INCREF(__pyx_int_0);
     __Pyx_GIVEREF(__pyx_int_0);
     PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_9, __pyx_int_0);
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3805, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3812, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   }
@@ -30278,27 +30341,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_82binomial(struct __pyx_obj_6mtr
   __pyx_t_1 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_10, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
   __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3805, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3812, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3805, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3812, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (unlikely(__pyx_t_4)) {
 
-    /* "mtrand.pyx":3806
+    /* "mtrand.pyx":3813
  *             raise ValueError("n < 0")
  *         if np.any(np.less(p, 0)):
  *             raise ValueError("p < 0")             # <<<<<<<<<<<<<<
  *         if np.any(np.greater(p, 1)):
  *             raise ValueError("p > 1")
  */
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3806, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3813, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __PYX_ERR(0, 3806, __pyx_L1_error)
+    __PYX_ERR(0, 3813, __pyx_L1_error)
 
-    /* "mtrand.pyx":3805
+    /* "mtrand.pyx":3812
  *         if np.any(np.less(n, 0)):
  *             raise ValueError("n < 0")
  *         if np.any(np.less(p, 0)):             # <<<<<<<<<<<<<<
@@ -30307,21 +30370,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_82binomial(struct __pyx_obj_6mtr
  */
   }
 
-  /* "mtrand.pyx":3807
+  /* "mtrand.pyx":3814
  *         if np.any(np.less(p, 0)):
  *             raise ValueError("p < 0")
  *         if np.any(np.greater(p, 1)):             # <<<<<<<<<<<<<<
  *             raise ValueError("p > 1")
  *         return discnp_array(self.internal_state, rk_binomial, size, on, op,
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3807, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3814, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_any); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3807, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_any); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3814, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3807, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3814, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_10);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_greater); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3807, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_greater); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3814, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
   __pyx_t_10 = NULL;
@@ -30339,7 +30402,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_82binomial(struct __pyx_obj_6mtr
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_7)) {
     PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_v_p, __pyx_int_1};
-    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3807, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3814, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
     __Pyx_GOTREF(__pyx_t_3);
   } else
@@ -30347,13 +30410,13 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_82binomial(struct __pyx_obj_6mtr
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
     PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_v_p, __pyx_int_1};
-    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3807, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3814, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
     __Pyx_GOTREF(__pyx_t_3);
   } else
   #endif
   {
-    __pyx_t_8 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3807, __pyx_L1_error)
+    __pyx_t_8 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3814, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_8);
     if (__pyx_t_10) {
       __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_10); __pyx_t_10 = NULL;
@@ -30364,7 +30427,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_82binomial(struct __pyx_obj_6mtr
     __Pyx_INCREF(__pyx_int_1);
     __Pyx_GIVEREF(__pyx_int_1);
     PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_9, __pyx_int_1);
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3807, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3814, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   }
@@ -30382,27 +30445,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_82binomial(struct __pyx_obj_6mtr
   __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
   __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3807, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3814, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3807, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3814, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (unlikely(__pyx_t_4)) {
 
-    /* "mtrand.pyx":3808
+    /* "mtrand.pyx":3815
  *             raise ValueError("p < 0")
  *         if np.any(np.greater(p, 1)):
  *             raise ValueError("p > 1")             # <<<<<<<<<<<<<<
  *         return discnp_array(self.internal_state, rk_binomial, size, on, op,
  *                             self.lock)
  */
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3808, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3815, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __PYX_ERR(0, 3808, __pyx_L1_error)
+    __PYX_ERR(0, 3815, __pyx_L1_error)
 
-    /* "mtrand.pyx":3807
+    /* "mtrand.pyx":3814
  *         if np.any(np.less(p, 0)):
  *             raise ValueError("p < 0")
  *         if np.any(np.greater(p, 1)):             # <<<<<<<<<<<<<<
@@ -30411,7 +30474,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_82binomial(struct __pyx_obj_6mtr
  */
   }
 
-  /* "mtrand.pyx":3809
+  /* "mtrand.pyx":3816
  *         if np.any(np.greater(p, 1)):
  *             raise ValueError("p > 1")
  *         return discnp_array(self.internal_state, rk_binomial, size, on, op,             # <<<<<<<<<<<<<<
@@ -30420,7 +30483,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_82binomial(struct __pyx_obj_6mtr
  */
   __Pyx_XDECREF(__pyx_r);
 
-  /* "mtrand.pyx":3810
+  /* "mtrand.pyx":3817
  *             raise ValueError("p > 1")
  *         return discnp_array(self.internal_state, rk_binomial, size, on, op,
  *                             self.lock)             # <<<<<<<<<<<<<<
@@ -30430,21 +30493,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_82binomial(struct __pyx_obj_6mtr
   __pyx_t_1 = __pyx_v_self->lock;
   __Pyx_INCREF(__pyx_t_1);
 
-  /* "mtrand.pyx":3809
+  /* "mtrand.pyx":3816
  *         if np.any(np.greater(p, 1)):
  *             raise ValueError("p > 1")
  *         return discnp_array(self.internal_state, rk_binomial, size, on, op,             # <<<<<<<<<<<<<<
  *                             self.lock)
  * 
  */
-  __pyx_t_2 = __pyx_f_6mtrand_discnp_array(__pyx_v_self->internal_state, rk_binomial, __pyx_v_size, __pyx_v_on, __pyx_v_op, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3809, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_6mtrand_discnp_array(__pyx_v_self->internal_state, rk_binomial, __pyx_v_size, __pyx_v_on, __pyx_v_op, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3816, __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;
 
-  /* "mtrand.pyx":3696
+  /* "mtrand.pyx":3703
  * 
  *     # Complicated, discrete distributions:
  *     def binomial(self, n, p, size=None):             # <<<<<<<<<<<<<<
@@ -30470,7 +30533,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_82binomial(struct __pyx_obj_6mtr
   return __pyx_r;
 }
 
-/* "mtrand.pyx":3812
+/* "mtrand.pyx":3819
  *                             self.lock)
  * 
  *     def negative_binomial(self, n, p, size=None):             # <<<<<<<<<<<<<<
@@ -30514,7 +30577,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_85negative_binomial(PyObject *__
         case  1:
         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("negative_binomial", 0, 2, 3, 1); __PYX_ERR(0, 3812, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("negative_binomial", 0, 2, 3, 1); __PYX_ERR(0, 3819, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  2:
@@ -30524,7 +30587,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_85negative_binomial(PyObject *__
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "negative_binomial") < 0)) __PYX_ERR(0, 3812, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "negative_binomial") < 0)) __PYX_ERR(0, 3819, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -30542,7 +30605,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_85negative_binomial(PyObject *__
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("negative_binomial", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3812, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("negative_binomial", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3819, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("mtrand.RandomState.negative_binomial", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -30573,14 +30636,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_84negative_binomial(struct __pyx
   PyObject *__pyx_t_9 = NULL;
   __Pyx_RefNannySetupContext("negative_binomial", 0);
 
-  /* "mtrand.pyx":3886
+  /* "mtrand.pyx":3893
  *         cdef double fp
  * 
  *         on = <ndarray>PyArray_FROM_OTF(n, NPY_DOUBLE, NPY_ARRAY_ALIGNED)             # <<<<<<<<<<<<<<
  *         op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  */
-  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_n, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3886, __pyx_L1_error)
+  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_n, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3893, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_2 = __pyx_t_1;
   __Pyx_INCREF(__pyx_t_2);
@@ -30588,14 +30651,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_84negative_binomial(struct __pyx
   __pyx_v_on = ((PyArrayObject *)__pyx_t_2);
   __pyx_t_2 = 0;
 
-  /* "mtrand.pyx":3887
+  /* "mtrand.pyx":3894
  * 
  *         on = <ndarray>PyArray_FROM_OTF(n, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  *         op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ARRAY_ALIGNED)             # <<<<<<<<<<<<<<
  * 
  *         if on.shape == op.shape == ():
  */
-  __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_p, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3887, __pyx_L1_error)
+  __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_p, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3894, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_1 = __pyx_t_2;
   __Pyx_INCREF(__pyx_t_1);
@@ -30603,49 +30666,49 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_84negative_binomial(struct __pyx
   __pyx_v_op = ((PyArrayObject *)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "mtrand.pyx":3889
+  /* "mtrand.pyx":3896
  *         op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if on.shape == op.shape == ():             # <<<<<<<<<<<<<<
  *             fp = PyFloat_AsDouble(p)
  *             fn = PyFloat_AsDouble(n)
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_on), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3889, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_on), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3896, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_op), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3889, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_op), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3896, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3889, __pyx_L1_error)
+  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3896, __pyx_L1_error)
   if (__Pyx_PyObject_IsTrue(__pyx_t_3)) {
     __Pyx_DECREF(__pyx_t_3);
-    __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3889, __pyx_L1_error)
+    __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3896, __pyx_L1_error)
   }
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3889, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3896, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   if (__pyx_t_4) {
 
-    /* "mtrand.pyx":3890
+    /* "mtrand.pyx":3897
  * 
  *         if on.shape == op.shape == ():
  *             fp = PyFloat_AsDouble(p)             # <<<<<<<<<<<<<<
  *             fn = PyFloat_AsDouble(n)
  * 
  */
-    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_p); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 3890, __pyx_L1_error)
+    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_p); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 3897, __pyx_L1_error)
     __pyx_v_fp = __pyx_t_5;
 
-    /* "mtrand.pyx":3891
+    /* "mtrand.pyx":3898
  *         if on.shape == op.shape == ():
  *             fp = PyFloat_AsDouble(p)
  *             fn = PyFloat_AsDouble(n)             # <<<<<<<<<<<<<<
  * 
  *             if fn <= 0:
  */
-    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_n); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 3891, __pyx_L1_error)
+    __pyx_t_5 = PyFloat_AsDouble(__pyx_v_n); if (unlikely(__pyx_t_5 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 3898, __pyx_L1_error)
     __pyx_v_fn = __pyx_t_5;
 
-    /* "mtrand.pyx":3893
+    /* "mtrand.pyx":3900
  *             fn = PyFloat_AsDouble(n)
  * 
  *             if fn <= 0:             # <<<<<<<<<<<<<<
@@ -30655,20 +30718,20 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_84negative_binomial(struct __pyx
     __pyx_t_4 = ((__pyx_v_fn <= 0.0) != 0);
     if (unlikely(__pyx_t_4)) {
 
-      /* "mtrand.pyx":3894
+      /* "mtrand.pyx":3901
  * 
  *             if fn <= 0:
  *                 raise ValueError("n <= 0")             # <<<<<<<<<<<<<<
  *             if fp < 0:
  *                 raise ValueError("p < 0")
  */
-      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3894, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3901, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __PYX_ERR(0, 3894, __pyx_L1_error)
+      __PYX_ERR(0, 3901, __pyx_L1_error)
 
-      /* "mtrand.pyx":3893
+      /* "mtrand.pyx":3900
  *             fn = PyFloat_AsDouble(n)
  * 
  *             if fn <= 0:             # <<<<<<<<<<<<<<
@@ -30677,7 +30740,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_84negative_binomial(struct __pyx
  */
     }
 
-    /* "mtrand.pyx":3895
+    /* "mtrand.pyx":3902
  *             if fn <= 0:
  *                 raise ValueError("n <= 0")
  *             if fp < 0:             # <<<<<<<<<<<<<<
@@ -30687,20 +30750,20 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_84negative_binomial(struct __pyx
     __pyx_t_4 = ((__pyx_v_fp < 0.0) != 0);
     if (unlikely(__pyx_t_4)) {
 
-      /* "mtrand.pyx":3896
+      /* "mtrand.pyx":3903
  *                 raise ValueError("n <= 0")
  *             if fp < 0:
  *                 raise ValueError("p < 0")             # <<<<<<<<<<<<<<
  *             elif fp > 1:
  *                 raise ValueError("p > 1")
  */
-      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3896, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3903, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __PYX_ERR(0, 3896, __pyx_L1_error)
+      __PYX_ERR(0, 3903, __pyx_L1_error)
 
-      /* "mtrand.pyx":3895
+      /* "mtrand.pyx":3902
  *             if fn <= 0:
  *                 raise ValueError("n <= 0")
  *             if fp < 0:             # <<<<<<<<<<<<<<
@@ -30709,7 +30772,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_84negative_binomial(struct __pyx
  */
     }
 
-    /* "mtrand.pyx":3897
+    /* "mtrand.pyx":3904
  *             if fp < 0:
  *                 raise ValueError("p < 0")
  *             elif fp > 1:             # <<<<<<<<<<<<<<
@@ -30719,20 +30782,20 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_84negative_binomial(struct __pyx
     __pyx_t_4 = ((__pyx_v_fp > 1.0) != 0);
     if (unlikely(__pyx_t_4)) {
 
-      /* "mtrand.pyx":3898
+      /* "mtrand.pyx":3905
  *                 raise ValueError("p < 0")
  *             elif fp > 1:
  *                 raise ValueError("p > 1")             # <<<<<<<<<<<<<<
  *             return discdd_array_sc(self.internal_state, rk_negative_binomial,
  *                                    size, fn, fp, self.lock)
  */
-      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3898, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3905, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __PYX_ERR(0, 3898, __pyx_L1_error)
+      __PYX_ERR(0, 3905, __pyx_L1_error)
 
-      /* "mtrand.pyx":3897
+      /* "mtrand.pyx":3904
  *             if fp < 0:
  *                 raise ValueError("p < 0")
  *             elif fp > 1:             # <<<<<<<<<<<<<<
@@ -30741,7 +30804,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_84negative_binomial(struct __pyx
  */
     }
 
-    /* "mtrand.pyx":3899
+    /* "mtrand.pyx":3906
  *             elif fp > 1:
  *                 raise ValueError("p > 1")
  *             return discdd_array_sc(self.internal_state, rk_negative_binomial,             # <<<<<<<<<<<<<<
@@ -30750,7 +30813,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_84negative_binomial(struct __pyx
  */
     __Pyx_XDECREF(__pyx_r);
 
-    /* "mtrand.pyx":3900
+    /* "mtrand.pyx":3907
  *                 raise ValueError("p > 1")
  *             return discdd_array_sc(self.internal_state, rk_negative_binomial,
  *                                    size, fn, fp, self.lock)             # <<<<<<<<<<<<<<
@@ -30760,21 +30823,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_84negative_binomial(struct __pyx
     __pyx_t_3 = __pyx_v_self->lock;
     __Pyx_INCREF(__pyx_t_3);
 
-    /* "mtrand.pyx":3899
+    /* "mtrand.pyx":3906
  *             elif fp > 1:
  *                 raise ValueError("p > 1")
  *             return discdd_array_sc(self.internal_state, rk_negative_binomial,             # <<<<<<<<<<<<<<
  *                                    size, fn, fp, self.lock)
  * 
  */
-    __pyx_t_2 = __pyx_f_6mtrand_discdd_array_sc(__pyx_v_self->internal_state, rk_negative_binomial, __pyx_v_size, __pyx_v_fn, __pyx_v_fp, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3899, __pyx_L1_error)
+    __pyx_t_2 = __pyx_f_6mtrand_discdd_array_sc(__pyx_v_self->internal_state, rk_negative_binomial, __pyx_v_size, __pyx_v_fn, __pyx_v_fp, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3906, __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;
 
-    /* "mtrand.pyx":3889
+    /* "mtrand.pyx":3896
  *         op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if on.shape == op.shape == ():             # <<<<<<<<<<<<<<
@@ -30783,21 +30846,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_84negative_binomial(struct __pyx
  */
   }
 
-  /* "mtrand.pyx":3902
+  /* "mtrand.pyx":3909
  *                                    size, fn, fp, self.lock)
  * 
  *         if np.any(np.less_equal(n, 0)):             # <<<<<<<<<<<<<<
  *             raise ValueError("n <= 0")
  *         if np.any(np.less(p, 0)):
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3902, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3909, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_any); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3902, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_any); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3909, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3902, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3909, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_less_equal); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3902, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_less_equal); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3909, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   __pyx_t_6 = NULL;
@@ -30815,7 +30878,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_84negative_binomial(struct __pyx
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_7)) {
     PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_n, __pyx_int_0};
-    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3902, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3909, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_GOTREF(__pyx_t_3);
   } else
@@ -30823,13 +30886,13 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_84negative_binomial(struct __pyx
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
     PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_n, __pyx_int_0};
-    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3902, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3909, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_GOTREF(__pyx_t_3);
   } else
   #endif
   {
-    __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3902, __pyx_L1_error)
+    __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3909, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_9);
     if (__pyx_t_6) {
       __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL;
@@ -30840,7 +30903,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_84negative_binomial(struct __pyx
     __Pyx_INCREF(__pyx_int_0);
     __Pyx_GIVEREF(__pyx_int_0);
     PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_int_0);
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3902, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3909, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
   }
@@ -30858,27 +30921,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_84negative_binomial(struct __pyx
   __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_7, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3);
   __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3902, __pyx_L1_error)
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3909, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3902, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3909, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (unlikely(__pyx_t_4)) {
 
-    /* "mtrand.pyx":3903
+    /* "mtrand.pyx":3910
  * 
  *         if np.any(np.less_equal(n, 0)):
  *             raise ValueError("n <= 0")             # <<<<<<<<<<<<<<
  *         if np.any(np.less(p, 0)):
  *             raise ValueError("p < 0")
  */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3903, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3910, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __PYX_ERR(0, 3903, __pyx_L1_error)
+    __PYX_ERR(0, 3910, __pyx_L1_error)
 
-    /* "mtrand.pyx":3902
+    /* "mtrand.pyx":3909
  *                                    size, fn, fp, self.lock)
  * 
  *         if np.any(np.less_equal(n, 0)):             # <<<<<<<<<<<<<<
@@ -30887,21 +30950,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_84negative_binomial(struct __pyx
  */
   }
 
-  /* "mtrand.pyx":3904
+  /* "mtrand.pyx":3911
  *         if np.any(np.less_equal(n, 0)):
  *             raise ValueError("n <= 0")
  *         if np.any(np.less(p, 0)):             # <<<<<<<<<<<<<<
  *             raise ValueError("p < 0")
  *         if np.any(np.greater(p, 1)):
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3904, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3911, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_any); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3904, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_any); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3911, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3904, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3911, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_less); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3904, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_less); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3911, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   __pyx_t_7 = NULL;
@@ -30919,7 +30982,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_84negative_binomial(struct __pyx
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_9)) {
     PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_p, __pyx_int_0};
-    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3904, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3911, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
@@ -30927,13 +30990,13 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_84negative_binomial(struct __pyx
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
     PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_p, __pyx_int_0};
-    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3904, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3911, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
   #endif
   {
-    __pyx_t_6 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3904, __pyx_L1_error)
+    __pyx_t_6 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3911, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     if (__pyx_t_7) {
       __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = NULL;
@@ -30944,7 +31007,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_84negative_binomial(struct __pyx
     __Pyx_INCREF(__pyx_int_0);
     __Pyx_GIVEREF(__pyx_int_0);
     PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_int_0);
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3904, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3911, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   }
@@ -30962,27 +31025,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_84negative_binomial(struct __pyx
   __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_9, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1);
   __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3904, __pyx_L1_error)
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3911, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3904, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3911, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (unlikely(__pyx_t_4)) {
 
-    /* "mtrand.pyx":3905
+    /* "mtrand.pyx":3912
  *             raise ValueError("n <= 0")
  *         if np.any(np.less(p, 0)):
  *             raise ValueError("p < 0")             # <<<<<<<<<<<<<<
  *         if np.any(np.greater(p, 1)):
  *             raise ValueError("p > 1")
  */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3905, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3912, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __PYX_ERR(0, 3905, __pyx_L1_error)
+    __PYX_ERR(0, 3912, __pyx_L1_error)
 
-    /* "mtrand.pyx":3904
+    /* "mtrand.pyx":3911
  *         if np.any(np.less_equal(n, 0)):
  *             raise ValueError("n <= 0")
  *         if np.any(np.less(p, 0)):             # <<<<<<<<<<<<<<
@@ -30991,21 +31054,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_84negative_binomial(struct __pyx
  */
   }
 
-  /* "mtrand.pyx":3906
+  /* "mtrand.pyx":3913
  *         if np.any(np.less(p, 0)):
  *             raise ValueError("p < 0")
  *         if np.any(np.greater(p, 1)):             # <<<<<<<<<<<<<<
  *             raise ValueError("p > 1")
  *         return discdd_array(self.internal_state, rk_negative_binomial, size,
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3906, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3913, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_any); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3906, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_any); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3913, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3906, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3913, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_greater); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3906, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_greater); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3913, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
   __pyx_t_9 = NULL;
@@ -31023,7 +31086,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_84negative_binomial(struct __pyx
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_6)) {
     PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_p, __pyx_int_1};
-    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3906, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3913, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
     __Pyx_GOTREF(__pyx_t_3);
   } else
@@ -31031,13 +31094,13 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_84negative_binomial(struct __pyx
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
     PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_p, __pyx_int_1};
-    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3906, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3913, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
     __Pyx_GOTREF(__pyx_t_3);
   } else
   #endif
   {
-    __pyx_t_7 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3906, __pyx_L1_error)
+    __pyx_t_7 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3913, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_7);
     if (__pyx_t_9) {
       __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9); __pyx_t_9 = NULL;
@@ -31048,7 +31111,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_84negative_binomial(struct __pyx
     __Pyx_INCREF(__pyx_int_1);
     __Pyx_GIVEREF(__pyx_int_1);
     PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_int_1);
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3906, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3913, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   }
@@ -31066,27 +31129,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_84negative_binomial(struct __pyx
   __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3);
   __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3906, __pyx_L1_error)
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3913, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3906, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3913, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (unlikely(__pyx_t_4)) {
 
-    /* "mtrand.pyx":3907
+    /* "mtrand.pyx":3914
  *             raise ValueError("p < 0")
  *         if np.any(np.greater(p, 1)):
  *             raise ValueError("p > 1")             # <<<<<<<<<<<<<<
  *         return discdd_array(self.internal_state, rk_negative_binomial, size,
  *                             on, op, self.lock)
  */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3907, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3914, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __PYX_ERR(0, 3907, __pyx_L1_error)
+    __PYX_ERR(0, 3914, __pyx_L1_error)
 
-    /* "mtrand.pyx":3906
+    /* "mtrand.pyx":3913
  *         if np.any(np.less(p, 0)):
  *             raise ValueError("p < 0")
  *         if np.any(np.greater(p, 1)):             # <<<<<<<<<<<<<<
@@ -31095,7 +31158,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_84negative_binomial(struct __pyx
  */
   }
 
-  /* "mtrand.pyx":3908
+  /* "mtrand.pyx":3915
  *         if np.any(np.greater(p, 1)):
  *             raise ValueError("p > 1")
  *         return discdd_array(self.internal_state, rk_negative_binomial, size,             # <<<<<<<<<<<<<<
@@ -31104,7 +31167,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_84negative_binomial(struct __pyx
  */
   __Pyx_XDECREF(__pyx_r);
 
-  /* "mtrand.pyx":3909
+  /* "mtrand.pyx":3916
  *             raise ValueError("p > 1")
  *         return discdd_array(self.internal_state, rk_negative_binomial, size,
  *                             on, op, self.lock)             # <<<<<<<<<<<<<<
@@ -31114,21 +31177,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_84negative_binomial(struct __pyx
   __pyx_t_2 = __pyx_v_self->lock;
   __Pyx_INCREF(__pyx_t_2);
 
-  /* "mtrand.pyx":3908
+  /* "mtrand.pyx":3915
  *         if np.any(np.greater(p, 1)):
  *             raise ValueError("p > 1")
  *         return discdd_array(self.internal_state, rk_negative_binomial, size,             # <<<<<<<<<<<<<<
  *                             on, op, self.lock)
  * 
  */
-  __pyx_t_1 = __pyx_f_6mtrand_discdd_array(__pyx_v_self->internal_state, rk_negative_binomial, __pyx_v_size, __pyx_v_on, __pyx_v_op, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3908, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_6mtrand_discdd_array(__pyx_v_self->internal_state, rk_negative_binomial, __pyx_v_size, __pyx_v_on, __pyx_v_op, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3915, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "mtrand.pyx":3812
+  /* "mtrand.pyx":3819
  *                             self.lock)
  * 
  *     def negative_binomial(self, n, p, size=None):             # <<<<<<<<<<<<<<
@@ -31154,7 +31217,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_84negative_binomial(struct __pyx
   return __pyx_r;
 }
 
-/* "mtrand.pyx":3911
+/* "mtrand.pyx":3918
  *                             on, op, self.lock)
  * 
  *     def poisson(self, lam=1.0, size=None):             # <<<<<<<<<<<<<<
@@ -31202,7 +31265,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_87poisson(PyObject *__pyx_v_self
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "poisson") < 0)) __PYX_ERR(0, 3911, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "poisson") < 0)) __PYX_ERR(0, 3918, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -31219,7 +31282,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_87poisson(PyObject *__pyx_v_self
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("poisson", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3911, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("poisson", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3918, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("mtrand.RandomState.poisson", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -31249,14 +31312,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_86poisson(struct __pyx_obj_6mtra
   PyObject *__pyx_t_10 = NULL;
   __Pyx_RefNannySetupContext("poisson", 0);
 
-  /* "mtrand.pyx":3980
+  /* "mtrand.pyx":3987
  *         cdef double flam
  * 
  *         olam = <ndarray>PyArray_FROM_OTF(lam, NPY_DOUBLE, NPY_ARRAY_ALIGNED)             # <<<<<<<<<<<<<<
  * 
  *         if olam.shape == ():
  */
-  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_lam, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3980, __pyx_L1_error)
+  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_lam, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3987, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_2 = __pyx_t_1;
   __Pyx_INCREF(__pyx_t_2);
@@ -31264,57 +31327,57 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_86poisson(struct __pyx_obj_6mtra
   __pyx_v_olam = ((PyArrayObject *)__pyx_t_2);
   __pyx_t_2 = 0;
 
-  /* "mtrand.pyx":3982
+  /* "mtrand.pyx":3989
  *         olam = <ndarray>PyArray_FROM_OTF(lam, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if olam.shape == ():             # <<<<<<<<<<<<<<
  *             flam = PyFloat_AsDouble(lam)
  * 
  */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_olam), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3982, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_olam), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3989, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3982, __pyx_L1_error)
+  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3989, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 3982, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 3989, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (__pyx_t_3) {
 
-    /* "mtrand.pyx":3983
+    /* "mtrand.pyx":3990
  * 
  *         if olam.shape == ():
  *             flam = PyFloat_AsDouble(lam)             # <<<<<<<<<<<<<<
  * 
  *             if lam < 0:
  */
-    __pyx_t_4 = PyFloat_AsDouble(__pyx_v_lam); if (unlikely(__pyx_t_4 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 3983, __pyx_L1_error)
+    __pyx_t_4 = PyFloat_AsDouble(__pyx_v_lam); if (unlikely(__pyx_t_4 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 3990, __pyx_L1_error)
     __pyx_v_flam = __pyx_t_4;
 
-    /* "mtrand.pyx":3985
+    /* "mtrand.pyx":3992
  *             flam = PyFloat_AsDouble(lam)
  * 
  *             if lam < 0:             # <<<<<<<<<<<<<<
  *                 raise ValueError("lam < 0")
  *             if lam > self.poisson_lam_max:
  */
-    __pyx_t_1 = PyObject_RichCompare(__pyx_v_lam, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3985, __pyx_L1_error)
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 3985, __pyx_L1_error)
+    __pyx_t_1 = PyObject_RichCompare(__pyx_v_lam, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3992, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 3992, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     if (unlikely(__pyx_t_3)) {
 
-      /* "mtrand.pyx":3986
+      /* "mtrand.pyx":3993
  * 
  *             if lam < 0:
  *                 raise ValueError("lam < 0")             # <<<<<<<<<<<<<<
  *             if lam > self.poisson_lam_max:
  *                 raise ValueError("lam value too large")
  */
-      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3986, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3993, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_Raise(__pyx_t_1, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __PYX_ERR(0, 3986, __pyx_L1_error)
+      __PYX_ERR(0, 3993, __pyx_L1_error)
 
-      /* "mtrand.pyx":3985
+      /* "mtrand.pyx":3992
  *             flam = PyFloat_AsDouble(lam)
  * 
  *             if lam < 0:             # <<<<<<<<<<<<<<
@@ -31323,35 +31386,35 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_86poisson(struct __pyx_obj_6mtra
  */
     }
 
-    /* "mtrand.pyx":3987
+    /* "mtrand.pyx":3994
  *             if lam < 0:
  *                 raise ValueError("lam < 0")
  *             if lam > self.poisson_lam_max:             # <<<<<<<<<<<<<<
  *                 raise ValueError("lam value too large")
  *             return discd_array_sc(self.internal_state, rk_poisson, size, flam,
  */
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_poisson_lam_max); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3987, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_poisson_lam_max); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3994, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_2 = PyObject_RichCompare(__pyx_v_lam, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3987, __pyx_L1_error)
+    __pyx_t_2 = PyObject_RichCompare(__pyx_v_lam, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3994, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 3987, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 3994, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     if (unlikely(__pyx_t_3)) {
 
-      /* "mtrand.pyx":3988
+      /* "mtrand.pyx":3995
  *                 raise ValueError("lam < 0")
  *             if lam > self.poisson_lam_max:
  *                 raise ValueError("lam value too large")             # <<<<<<<<<<<<<<
  *             return discd_array_sc(self.internal_state, rk_poisson, size, flam,
  *                                   self.lock)
  */
-      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3988, __pyx_L1_error)
+      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3995, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_Raise(__pyx_t_2, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __PYX_ERR(0, 3988, __pyx_L1_error)
+      __PYX_ERR(0, 3995, __pyx_L1_error)
 
-      /* "mtrand.pyx":3987
+      /* "mtrand.pyx":3994
  *             if lam < 0:
  *                 raise ValueError("lam < 0")
  *             if lam > self.poisson_lam_max:             # <<<<<<<<<<<<<<
@@ -31360,7 +31423,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_86poisson(struct __pyx_obj_6mtra
  */
     }
 
-    /* "mtrand.pyx":3989
+    /* "mtrand.pyx":3996
  *             if lam > self.poisson_lam_max:
  *                 raise ValueError("lam value too large")
  *             return discd_array_sc(self.internal_state, rk_poisson, size, flam,             # <<<<<<<<<<<<<<
@@ -31369,7 +31432,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_86poisson(struct __pyx_obj_6mtra
  */
     __Pyx_XDECREF(__pyx_r);
 
-    /* "mtrand.pyx":3990
+    /* "mtrand.pyx":3997
  *                 raise ValueError("lam value too large")
  *             return discd_array_sc(self.internal_state, rk_poisson, size, flam,
  *                                   self.lock)             # <<<<<<<<<<<<<<
@@ -31379,21 +31442,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_86poisson(struct __pyx_obj_6mtra
     __pyx_t_2 = __pyx_v_self->lock;
     __Pyx_INCREF(__pyx_t_2);
 
-    /* "mtrand.pyx":3989
+    /* "mtrand.pyx":3996
  *             if lam > self.poisson_lam_max:
  *                 raise ValueError("lam value too large")
  *             return discd_array_sc(self.internal_state, rk_poisson, size, flam,             # <<<<<<<<<<<<<<
  *                                   self.lock)
  * 
  */
-    __pyx_t_1 = __pyx_f_6mtrand_discd_array_sc(__pyx_v_self->internal_state, rk_poisson, __pyx_v_size, __pyx_v_flam, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3989, __pyx_L1_error)
+    __pyx_t_1 = __pyx_f_6mtrand_discd_array_sc(__pyx_v_self->internal_state, rk_poisson, __pyx_v_size, __pyx_v_flam, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3996, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __pyx_r = __pyx_t_1;
     __pyx_t_1 = 0;
     goto __pyx_L0;
 
-    /* "mtrand.pyx":3982
+    /* "mtrand.pyx":3989
  *         olam = <ndarray>PyArray_FROM_OTF(lam, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if olam.shape == ():             # <<<<<<<<<<<<<<
@@ -31402,21 +31465,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_86poisson(struct __pyx_obj_6mtra
  */
   }
 
-  /* "mtrand.pyx":3992
+  /* "mtrand.pyx":3999
  *                                   self.lock)
  * 
  *         if np.any(np.less(olam, 0)):             # <<<<<<<<<<<<<<
  *             raise ValueError("lam < 0")
  *         if np.any(np.greater(olam, self.poisson_lam_max)):
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3992, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3999, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_any); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3992, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_any); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3999, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3992, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3999, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_less); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3992, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_less); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3999, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   __pyx_t_6 = NULL;
@@ -31434,7 +31497,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_86poisson(struct __pyx_obj_6mtra
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_7)) {
     PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_v_olam), __pyx_int_0};
-    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3992, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3999, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_GOTREF(__pyx_t_2);
   } else
@@ -31442,13 +31505,13 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_86poisson(struct __pyx_obj_6mtra
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
     PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_v_olam), __pyx_int_0};
-    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3992, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3999, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_GOTREF(__pyx_t_2);
   } else
   #endif
   {
-    __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3992, __pyx_L1_error)
+    __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3999, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_9);
     if (__pyx_t_6) {
       __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL;
@@ -31459,7 +31522,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_86poisson(struct __pyx_obj_6mtra
     __Pyx_INCREF(__pyx_int_0);
     __Pyx_GIVEREF(__pyx_int_0);
     PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_int_0);
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3992, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3999, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
   }
@@ -31477,27 +31540,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_86poisson(struct __pyx_obj_6mtra
   __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2);
   __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3992, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3999, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 3992, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 3999, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (unlikely(__pyx_t_3)) {
 
-    /* "mtrand.pyx":3993
+    /* "mtrand.pyx":4000
  * 
  *         if np.any(np.less(olam, 0)):
  *             raise ValueError("lam < 0")             # <<<<<<<<<<<<<<
  *         if np.any(np.greater(olam, self.poisson_lam_max)):
  *             raise ValueError("lam value too large.")
  */
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3993, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4000, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __PYX_ERR(0, 3993, __pyx_L1_error)
+    __PYX_ERR(0, 4000, __pyx_L1_error)
 
-    /* "mtrand.pyx":3992
+    /* "mtrand.pyx":3999
  *                                   self.lock)
  * 
  *         if np.any(np.less(olam, 0)):             # <<<<<<<<<<<<<<
@@ -31506,24 +31569,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_86poisson(struct __pyx_obj_6mtra
  */
   }
 
-  /* "mtrand.pyx":3994
+  /* "mtrand.pyx":4001
  *         if np.any(np.less(olam, 0)):
  *             raise ValueError("lam < 0")
  *         if np.any(np.greater(olam, self.poisson_lam_max)):             # <<<<<<<<<<<<<<
  *             raise ValueError("lam value too large.")
  *         return discd_array(self.internal_state, rk_poisson, size, olam,
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3994, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4001, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_any); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3994, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_any); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4001, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3994, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4001, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_greater); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3994, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_greater); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4001, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_poisson_lam_max); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3994, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_poisson_lam_max); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4001, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __pyx_t_6 = NULL;
   __pyx_t_8 = 0;
@@ -31540,7 +31603,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_86poisson(struct __pyx_obj_6mtra
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_9)) {
     PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_v_olam), __pyx_t_7};
-    __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3994, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4001, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
@@ -31549,14 +31612,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_86poisson(struct __pyx_obj_6mtra
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
     PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_v_olam), __pyx_t_7};
-    __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3994, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4001, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   } else
   #endif
   {
-    __pyx_t_10 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3994, __pyx_L1_error)
+    __pyx_t_10 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4001, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_10);
     if (__pyx_t_6) {
       __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6); __pyx_t_6 = NULL;
@@ -31567,7 +31630,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_86poisson(struct __pyx_obj_6mtra
     __Pyx_GIVEREF(__pyx_t_7);
     PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_8, __pyx_t_7);
     __pyx_t_7 = 0;
-    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3994, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4001, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
   }
@@ -31585,27 +31648,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_86poisson(struct __pyx_obj_6mtra
   __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_9, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5);
   __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3994, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4001, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 3994, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 4001, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (unlikely(__pyx_t_3)) {
 
-    /* "mtrand.pyx":3995
+    /* "mtrand.pyx":4002
  *             raise ValueError("lam < 0")
  *         if np.any(np.greater(olam, self.poisson_lam_max)):
  *             raise ValueError("lam value too large.")             # <<<<<<<<<<<<<<
  *         return discd_array(self.internal_state, rk_poisson, size, olam,
  *                            self.lock)
  */
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3995, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4002, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __PYX_ERR(0, 3995, __pyx_L1_error)
+    __PYX_ERR(0, 4002, __pyx_L1_error)
 
-    /* "mtrand.pyx":3994
+    /* "mtrand.pyx":4001
  *         if np.any(np.less(olam, 0)):
  *             raise ValueError("lam < 0")
  *         if np.any(np.greater(olam, self.poisson_lam_max)):             # <<<<<<<<<<<<<<
@@ -31614,7 +31677,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_86poisson(struct __pyx_obj_6mtra
  */
   }
 
-  /* "mtrand.pyx":3996
+  /* "mtrand.pyx":4003
  *         if np.any(np.greater(olam, self.poisson_lam_max)):
  *             raise ValueError("lam value too large.")
  *         return discd_array(self.internal_state, rk_poisson, size, olam,             # <<<<<<<<<<<<<<
@@ -31623,7 +31686,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_86poisson(struct __pyx_obj_6mtra
  */
   __Pyx_XDECREF(__pyx_r);
 
-  /* "mtrand.pyx":3997
+  /* "mtrand.pyx":4004
  *             raise ValueError("lam value too large.")
  *         return discd_array(self.internal_state, rk_poisson, size, olam,
  *                            self.lock)             # <<<<<<<<<<<<<<
@@ -31633,21 +31696,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_86poisson(struct __pyx_obj_6mtra
   __pyx_t_1 = __pyx_v_self->lock;
   __Pyx_INCREF(__pyx_t_1);
 
-  /* "mtrand.pyx":3996
+  /* "mtrand.pyx":4003
  *         if np.any(np.greater(olam, self.poisson_lam_max)):
  *             raise ValueError("lam value too large.")
  *         return discd_array(self.internal_state, rk_poisson, size, olam,             # <<<<<<<<<<<<<<
  *                            self.lock)
  * 
  */
-  __pyx_t_2 = __pyx_f_6mtrand_discd_array(__pyx_v_self->internal_state, rk_poisson, __pyx_v_size, __pyx_v_olam, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3996, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_6mtrand_discd_array(__pyx_v_self->internal_state, rk_poisson, __pyx_v_size, __pyx_v_olam, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4003, __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;
 
-  /* "mtrand.pyx":3911
+  /* "mtrand.pyx":3918
  *                             on, op, self.lock)
  * 
  *     def poisson(self, lam=1.0, size=None):             # <<<<<<<<<<<<<<
@@ -31673,7 +31736,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_86poisson(struct __pyx_obj_6mtra
   return __pyx_r;
 }
 
-/* "mtrand.pyx":3999
+/* "mtrand.pyx":4006
  *                            self.lock)
  * 
  *     def zipf(self, a, size=None):             # <<<<<<<<<<<<<<
@@ -31718,7 +31781,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_89zipf(PyObject *__pyx_v_self, P
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zipf") < 0)) __PYX_ERR(0, 3999, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zipf") < 0)) __PYX_ERR(0, 4006, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -31734,7 +31797,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_89zipf(PyObject *__pyx_v_self, P
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("zipf", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3999, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("zipf", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4006, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("mtrand.RandomState.zipf", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -31764,14 +31827,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_88zipf(struct __pyx_obj_6mtrand_
   int __pyx_t_10;
   __Pyx_RefNannySetupContext("zipf", 0);
 
-  /* "mtrand.pyx":4076
+  /* "mtrand.pyx":4083
  *         cdef double fa
  * 
  *         oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ARRAY_ALIGNED)             # <<<<<<<<<<<<<<
  * 
  *         if oa.shape == ():
  */
-  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_a, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4076, __pyx_L1_error)
+  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_a, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4083, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_2 = __pyx_t_1;
   __Pyx_INCREF(__pyx_t_2);
@@ -31779,32 +31842,32 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_88zipf(struct __pyx_obj_6mtrand_
   __pyx_v_oa = ((PyArrayObject *)__pyx_t_2);
   __pyx_t_2 = 0;
 
-  /* "mtrand.pyx":4078
+  /* "mtrand.pyx":4085
  *         oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if oa.shape == ():             # <<<<<<<<<<<<<<
  *             fa = PyFloat_AsDouble(a)
  * 
  */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_oa), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4078, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_oa), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4085, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4078, __pyx_L1_error)
+  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4085, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 4078, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 4085, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (__pyx_t_3) {
 
-    /* "mtrand.pyx":4079
+    /* "mtrand.pyx":4086
  * 
  *         if oa.shape == ():
  *             fa = PyFloat_AsDouble(a)             # <<<<<<<<<<<<<<
  * 
  *             # use logic that ensures NaN is rejected.
  */
-    __pyx_t_4 = PyFloat_AsDouble(__pyx_v_a); if (unlikely(__pyx_t_4 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 4079, __pyx_L1_error)
+    __pyx_t_4 = PyFloat_AsDouble(__pyx_v_a); if (unlikely(__pyx_t_4 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 4086, __pyx_L1_error)
     __pyx_v_fa = __pyx_t_4;
 
-    /* "mtrand.pyx":4082
+    /* "mtrand.pyx":4089
  * 
  *             # use logic that ensures NaN is rejected.
  *             if not fa > 1.0:             # <<<<<<<<<<<<<<
@@ -31814,20 +31877,20 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_88zipf(struct __pyx_obj_6mtrand_
     __pyx_t_3 = ((!((__pyx_v_fa > 1.0) != 0)) != 0);
     if (unlikely(__pyx_t_3)) {
 
-      /* "mtrand.pyx":4083
+      /* "mtrand.pyx":4090
  *             # use logic that ensures NaN is rejected.
  *             if not fa > 1.0:
  *                 raise ValueError("'a' must be a valid float > 1.0")             # <<<<<<<<<<<<<<
  *             return discd_array_sc(self.internal_state, rk_zipf, size, fa,
  *                                   self.lock)
  */
-      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4083, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4090, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_Raise(__pyx_t_1, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __PYX_ERR(0, 4083, __pyx_L1_error)
+      __PYX_ERR(0, 4090, __pyx_L1_error)
 
-      /* "mtrand.pyx":4082
+      /* "mtrand.pyx":4089
  * 
  *             # use logic that ensures NaN is rejected.
  *             if not fa > 1.0:             # <<<<<<<<<<<<<<
@@ -31836,7 +31899,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_88zipf(struct __pyx_obj_6mtrand_
  */
     }
 
-    /* "mtrand.pyx":4084
+    /* "mtrand.pyx":4091
  *             if not fa > 1.0:
  *                 raise ValueError("'a' must be a valid float > 1.0")
  *             return discd_array_sc(self.internal_state, rk_zipf, size, fa,             # <<<<<<<<<<<<<<
@@ -31845,7 +31908,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_88zipf(struct __pyx_obj_6mtrand_
  */
     __Pyx_XDECREF(__pyx_r);
 
-    /* "mtrand.pyx":4085
+    /* "mtrand.pyx":4092
  *                 raise ValueError("'a' must be a valid float > 1.0")
  *             return discd_array_sc(self.internal_state, rk_zipf, size, fa,
  *                                   self.lock)             # <<<<<<<<<<<<<<
@@ -31855,21 +31918,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_88zipf(struct __pyx_obj_6mtrand_
     __pyx_t_1 = __pyx_v_self->lock;
     __Pyx_INCREF(__pyx_t_1);
 
-    /* "mtrand.pyx":4084
+    /* "mtrand.pyx":4091
  *             if not fa > 1.0:
  *                 raise ValueError("'a' must be a valid float > 1.0")
  *             return discd_array_sc(self.internal_state, rk_zipf, size, fa,             # <<<<<<<<<<<<<<
  *                                   self.lock)
  * 
  */
-    __pyx_t_2 = __pyx_f_6mtrand_discd_array_sc(__pyx_v_self->internal_state, rk_zipf, __pyx_v_size, __pyx_v_fa, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4084, __pyx_L1_error)
+    __pyx_t_2 = __pyx_f_6mtrand_discd_array_sc(__pyx_v_self->internal_state, rk_zipf, __pyx_v_size, __pyx_v_fa, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4091, __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;
 
-    /* "mtrand.pyx":4078
+    /* "mtrand.pyx":4085
  *         oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if oa.shape == ():             # <<<<<<<<<<<<<<
@@ -31878,21 +31941,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_88zipf(struct __pyx_obj_6mtrand_
  */
   }
 
-  /* "mtrand.pyx":4088
+  /* "mtrand.pyx":4095
  * 
  *         # use logic that ensures NaN is rejected.
  *         if not np.all(np.greater(oa, 1.0)):             # <<<<<<<<<<<<<<
  *             raise ValueError("'a' must contain valid floats > 1.0")
  *         return discd_array(self.internal_state, rk_zipf, size, oa, self.lock)
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4088, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4095, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_all); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4088, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_all); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4095, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4088, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4095, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_greater); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4088, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_greater); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4095, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   __pyx_t_6 = NULL;
@@ -31910,7 +31973,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_88zipf(struct __pyx_obj_6mtrand_
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_7)) {
     PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_v_oa), __pyx_float_1_0};
-    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4088, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4095, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
@@ -31918,13 +31981,13 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_88zipf(struct __pyx_obj_6mtrand_
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
     PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_v_oa), __pyx_float_1_0};
-    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4088, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4095, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
   #endif
   {
-    __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4088, __pyx_L1_error)
+    __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4095, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_9);
     if (__pyx_t_6) {
       __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL;
@@ -31935,7 +31998,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_88zipf(struct __pyx_obj_6mtrand_
     __Pyx_INCREF(__pyx_float_1_0);
     __Pyx_GIVEREF(__pyx_float_1_0);
     PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_float_1_0);
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4088, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4095, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
   }
@@ -31953,28 +32016,28 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_88zipf(struct __pyx_obj_6mtrand_
   __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1);
   __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4088, __pyx_L1_error)
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4095, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 4088, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 4095, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_t_10 = ((!__pyx_t_3) != 0);
   if (unlikely(__pyx_t_10)) {
 
-    /* "mtrand.pyx":4089
+    /* "mtrand.pyx":4096
  *         # use logic that ensures NaN is rejected.
  *         if not np.all(np.greater(oa, 1.0)):
  *             raise ValueError("'a' must contain valid floats > 1.0")             # <<<<<<<<<<<<<<
  *         return discd_array(self.internal_state, rk_zipf, size, oa, self.lock)
  * 
  */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4089, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4096, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __PYX_ERR(0, 4089, __pyx_L1_error)
+    __PYX_ERR(0, 4096, __pyx_L1_error)
 
-    /* "mtrand.pyx":4088
+    /* "mtrand.pyx":4095
  * 
  *         # use logic that ensures NaN is rejected.
  *         if not np.all(np.greater(oa, 1.0)):             # <<<<<<<<<<<<<<
@@ -31983,7 +32046,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_88zipf(struct __pyx_obj_6mtrand_
  */
   }
 
-  /* "mtrand.pyx":4090
+  /* "mtrand.pyx":4097
  *         if not np.all(np.greater(oa, 1.0)):
  *             raise ValueError("'a' must contain valid floats > 1.0")
  *         return discd_array(self.internal_state, rk_zipf, size, oa, self.lock)             # <<<<<<<<<<<<<<
@@ -31993,14 +32056,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_88zipf(struct __pyx_obj_6mtrand_
   __Pyx_XDECREF(__pyx_r);
   __pyx_t_2 = __pyx_v_self->lock;
   __Pyx_INCREF(__pyx_t_2);
-  __pyx_t_5 = __pyx_f_6mtrand_discd_array(__pyx_v_self->internal_state, rk_zipf, __pyx_v_size, __pyx_v_oa, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4090, __pyx_L1_error)
+  __pyx_t_5 = __pyx_f_6mtrand_discd_array(__pyx_v_self->internal_state, rk_zipf, __pyx_v_size, __pyx_v_oa, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4097, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_r = __pyx_t_5;
   __pyx_t_5 = 0;
   goto __pyx_L0;
 
-  /* "mtrand.pyx":3999
+  /* "mtrand.pyx":4006
  *                            self.lock)
  * 
  *     def zipf(self, a, size=None):             # <<<<<<<<<<<<<<
@@ -32025,7 +32088,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_88zipf(struct __pyx_obj_6mtrand_
   return __pyx_r;
 }
 
-/* "mtrand.pyx":4092
+/* "mtrand.pyx":4099
  *         return discd_array(self.internal_state, rk_zipf, size, oa, self.lock)
  * 
  *     def geometric(self, p, size=None):             # <<<<<<<<<<<<<<
@@ -32070,7 +32133,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_91geometric(PyObject *__pyx_v_se
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "geometric") < 0)) __PYX_ERR(0, 4092, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "geometric") < 0)) __PYX_ERR(0, 4099, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -32086,7 +32149,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_91geometric(PyObject *__pyx_v_se
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("geometric", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4092, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("geometric", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4099, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("mtrand.RandomState.geometric", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -32115,14 +32178,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_90geometric(struct __pyx_obj_6mt
   PyObject *__pyx_t_9 = NULL;
   __Pyx_RefNannySetupContext("geometric", 0);
 
-  /* "mtrand.pyx":4141
+  /* "mtrand.pyx":4148
  *         cdef double fp
  * 
  *         op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ARRAY_ALIGNED)             # <<<<<<<<<<<<<<
  * 
  *         if op.shape == ():
  */
-  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_p, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4141, __pyx_L1_error)
+  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_p, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4148, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_2 = __pyx_t_1;
   __Pyx_INCREF(__pyx_t_2);
@@ -32130,32 +32193,32 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_90geometric(struct __pyx_obj_6mt
   __pyx_v_op = ((PyArrayObject *)__pyx_t_2);
   __pyx_t_2 = 0;
 
-  /* "mtrand.pyx":4143
+  /* "mtrand.pyx":4150
  *         op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if op.shape == ():             # <<<<<<<<<<<<<<
  *             fp = PyFloat_AsDouble(p)
  * 
  */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_op), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4143, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_op), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4150, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4143, __pyx_L1_error)
+  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4150, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 4143, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 4150, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (__pyx_t_3) {
 
-    /* "mtrand.pyx":4144
+    /* "mtrand.pyx":4151
  * 
  *         if op.shape == ():
  *             fp = PyFloat_AsDouble(p)             # <<<<<<<<<<<<<<
  * 
  *             if fp <= 0.0:
  */
-    __pyx_t_4 = PyFloat_AsDouble(__pyx_v_p); if (unlikely(__pyx_t_4 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 4144, __pyx_L1_error)
+    __pyx_t_4 = PyFloat_AsDouble(__pyx_v_p); if (unlikely(__pyx_t_4 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 4151, __pyx_L1_error)
     __pyx_v_fp = __pyx_t_4;
 
-    /* "mtrand.pyx":4146
+    /* "mtrand.pyx":4153
  *             fp = PyFloat_AsDouble(p)
  * 
  *             if fp <= 0.0:             # <<<<<<<<<<<<<<
@@ -32165,20 +32228,20 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_90geometric(struct __pyx_obj_6mt
     __pyx_t_3 = ((__pyx_v_fp <= 0.0) != 0);
     if (unlikely(__pyx_t_3)) {
 
-      /* "mtrand.pyx":4147
+      /* "mtrand.pyx":4154
  * 
  *             if fp <= 0.0:
  *                 raise ValueError("p <= 0.0")             # <<<<<<<<<<<<<<
  *             if fp > 1.0:
  *                 raise ValueError("p > 1.0")
  */
-      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4147, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4154, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_Raise(__pyx_t_1, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __PYX_ERR(0, 4147, __pyx_L1_error)
+      __PYX_ERR(0, 4154, __pyx_L1_error)
 
-      /* "mtrand.pyx":4146
+      /* "mtrand.pyx":4153
  *             fp = PyFloat_AsDouble(p)
  * 
  *             if fp <= 0.0:             # <<<<<<<<<<<<<<
@@ -32187,7 +32250,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_90geometric(struct __pyx_obj_6mt
  */
     }
 
-    /* "mtrand.pyx":4148
+    /* "mtrand.pyx":4155
  *             if fp <= 0.0:
  *                 raise ValueError("p <= 0.0")
  *             if fp > 1.0:             # <<<<<<<<<<<<<<
@@ -32197,20 +32260,20 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_90geometric(struct __pyx_obj_6mt
     __pyx_t_3 = ((__pyx_v_fp > 1.0) != 0);
     if (unlikely(__pyx_t_3)) {
 
-      /* "mtrand.pyx":4149
+      /* "mtrand.pyx":4156
  *                 raise ValueError("p <= 0.0")
  *             if fp > 1.0:
  *                 raise ValueError("p > 1.0")             # <<<<<<<<<<<<<<
  *             return discd_array_sc(self.internal_state, rk_geometric, size, fp,
  *                                   self.lock)
  */
-      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4149, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4156, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_Raise(__pyx_t_1, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __PYX_ERR(0, 4149, __pyx_L1_error)
+      __PYX_ERR(0, 4156, __pyx_L1_error)
 
-      /* "mtrand.pyx":4148
+      /* "mtrand.pyx":4155
  *             if fp <= 0.0:
  *                 raise ValueError("p <= 0.0")
  *             if fp > 1.0:             # <<<<<<<<<<<<<<
@@ -32219,7 +32282,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_90geometric(struct __pyx_obj_6mt
  */
     }
 
-    /* "mtrand.pyx":4150
+    /* "mtrand.pyx":4157
  *             if fp > 1.0:
  *                 raise ValueError("p > 1.0")
  *             return discd_array_sc(self.internal_state, rk_geometric, size, fp,             # <<<<<<<<<<<<<<
@@ -32228,7 +32291,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_90geometric(struct __pyx_obj_6mt
  */
     __Pyx_XDECREF(__pyx_r);
 
-    /* "mtrand.pyx":4151
+    /* "mtrand.pyx":4158
  *                 raise ValueError("p > 1.0")
  *             return discd_array_sc(self.internal_state, rk_geometric, size, fp,
  *                                   self.lock)             # <<<<<<<<<<<<<<
@@ -32238,21 +32301,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_90geometric(struct __pyx_obj_6mt
     __pyx_t_1 = __pyx_v_self->lock;
     __Pyx_INCREF(__pyx_t_1);
 
-    /* "mtrand.pyx":4150
+    /* "mtrand.pyx":4157
  *             if fp > 1.0:
  *                 raise ValueError("p > 1.0")
  *             return discd_array_sc(self.internal_state, rk_geometric, size, fp,             # <<<<<<<<<<<<<<
  *                                   self.lock)
  * 
  */
-    __pyx_t_2 = __pyx_f_6mtrand_discd_array_sc(__pyx_v_self->internal_state, rk_geometric, __pyx_v_size, __pyx_v_fp, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4150, __pyx_L1_error)
+    __pyx_t_2 = __pyx_f_6mtrand_discd_array_sc(__pyx_v_self->internal_state, rk_geometric, __pyx_v_size, __pyx_v_fp, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4157, __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;
 
-    /* "mtrand.pyx":4143
+    /* "mtrand.pyx":4150
  *         op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if op.shape == ():             # <<<<<<<<<<<<<<
@@ -32261,21 +32324,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_90geometric(struct __pyx_obj_6mt
  */
   }
 
-  /* "mtrand.pyx":4153
+  /* "mtrand.pyx":4160
  *                                   self.lock)
  * 
  *         if np.any(np.less_equal(op, 0.0)):             # <<<<<<<<<<<<<<
  *             raise ValueError("p <= 0.0")
  *         if np.any(np.greater(op, 1.0)):
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4153, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4160, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_any); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4153, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_any); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4160, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4153, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4160, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_less_equal); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4153, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_less_equal); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4160, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   __pyx_t_6 = NULL;
@@ -32293,7 +32356,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_90geometric(struct __pyx_obj_6mt
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_7)) {
     PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_v_op), __pyx_float_0_0};
-    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4153, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4160, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
@@ -32301,13 +32364,13 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_90geometric(struct __pyx_obj_6mt
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
     PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_v_op), __pyx_float_0_0};
-    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4153, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4160, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
   #endif
   {
-    __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4153, __pyx_L1_error)
+    __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4160, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_9);
     if (__pyx_t_6) {
       __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL;
@@ -32318,7 +32381,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_90geometric(struct __pyx_obj_6mt
     __Pyx_INCREF(__pyx_float_0_0);
     __Pyx_GIVEREF(__pyx_float_0_0);
     PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_float_0_0);
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4153, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4160, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
   }
@@ -32336,27 +32399,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_90geometric(struct __pyx_obj_6mt
   __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1);
   __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4153, __pyx_L1_error)
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4160, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 4153, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 4160, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (unlikely(__pyx_t_3)) {
 
-    /* "mtrand.pyx":4154
+    /* "mtrand.pyx":4161
  * 
  *         if np.any(np.less_equal(op, 0.0)):
  *             raise ValueError("p <= 0.0")             # <<<<<<<<<<<<<<
  *         if np.any(np.greater(op, 1.0)):
  *             raise ValueError("p > 1.0")
  */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4154, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4161, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __PYX_ERR(0, 4154, __pyx_L1_error)
+    __PYX_ERR(0, 4161, __pyx_L1_error)
 
-    /* "mtrand.pyx":4153
+    /* "mtrand.pyx":4160
  *                                   self.lock)
  * 
  *         if np.any(np.less_equal(op, 0.0)):             # <<<<<<<<<<<<<<
@@ -32365,21 +32428,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_90geometric(struct __pyx_obj_6mt
  */
   }
 
-  /* "mtrand.pyx":4155
+  /* "mtrand.pyx":4162
  *         if np.any(np.less_equal(op, 0.0)):
  *             raise ValueError("p <= 0.0")
  *         if np.any(np.greater(op, 1.0)):             # <<<<<<<<<<<<<<
  *             raise ValueError("p > 1.0")
  *         return discd_array(self.internal_state, rk_geometric, size, op,
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4155, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4162, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_any); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4155, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_any); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4162, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4155, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4162, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_greater); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4155, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_greater); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4162, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   __pyx_t_7 = NULL;
@@ -32397,7 +32460,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_90geometric(struct __pyx_obj_6mt
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_9)) {
     PyObject *__pyx_temp[3] = {__pyx_t_7, ((PyObject *)__pyx_v_op), __pyx_float_1_0};
-    __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4155, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4162, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
     __Pyx_GOTREF(__pyx_t_5);
   } else
@@ -32405,13 +32468,13 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_90geometric(struct __pyx_obj_6mt
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
     PyObject *__pyx_temp[3] = {__pyx_t_7, ((PyObject *)__pyx_v_op), __pyx_float_1_0};
-    __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4155, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4162, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
     __Pyx_GOTREF(__pyx_t_5);
   } else
   #endif
   {
-    __pyx_t_6 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4155, __pyx_L1_error)
+    __pyx_t_6 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4162, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     if (__pyx_t_7) {
       __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = NULL;
@@ -32422,7 +32485,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_90geometric(struct __pyx_obj_6mt
     __Pyx_INCREF(__pyx_float_1_0);
     __Pyx_GIVEREF(__pyx_float_1_0);
     PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_float_1_0);
-    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4155, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4162, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   }
@@ -32440,27 +32503,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_90geometric(struct __pyx_obj_6mt
   __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_9, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5);
   __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4155, __pyx_L1_error)
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4162, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 4155, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 4162, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (unlikely(__pyx_t_3)) {
 
-    /* "mtrand.pyx":4156
+    /* "mtrand.pyx":4163
  *             raise ValueError("p <= 0.0")
  *         if np.any(np.greater(op, 1.0)):
  *             raise ValueError("p > 1.0")             # <<<<<<<<<<<<<<
  *         return discd_array(self.internal_state, rk_geometric, size, op,
  *                            self.lock)
  */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4156, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4163, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __PYX_ERR(0, 4156, __pyx_L1_error)
+    __PYX_ERR(0, 4163, __pyx_L1_error)
 
-    /* "mtrand.pyx":4155
+    /* "mtrand.pyx":4162
  *         if np.any(np.less_equal(op, 0.0)):
  *             raise ValueError("p <= 0.0")
  *         if np.any(np.greater(op, 1.0)):             # <<<<<<<<<<<<<<
@@ -32469,7 +32532,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_90geometric(struct __pyx_obj_6mt
  */
   }
 
-  /* "mtrand.pyx":4157
+  /* "mtrand.pyx":4164
  *         if np.any(np.greater(op, 1.0)):
  *             raise ValueError("p > 1.0")
  *         return discd_array(self.internal_state, rk_geometric, size, op,             # <<<<<<<<<<<<<<
@@ -32478,7 +32541,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_90geometric(struct __pyx_obj_6mt
  */
   __Pyx_XDECREF(__pyx_r);
 
-  /* "mtrand.pyx":4158
+  /* "mtrand.pyx":4165
  *             raise ValueError("p > 1.0")
  *         return discd_array(self.internal_state, rk_geometric, size, op,
  *                            self.lock)             # <<<<<<<<<<<<<<
@@ -32488,21 +32551,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_90geometric(struct __pyx_obj_6mt
   __pyx_t_2 = __pyx_v_self->lock;
   __Pyx_INCREF(__pyx_t_2);
 
-  /* "mtrand.pyx":4157
+  /* "mtrand.pyx":4164
  *         if np.any(np.greater(op, 1.0)):
  *             raise ValueError("p > 1.0")
  *         return discd_array(self.internal_state, rk_geometric, size, op,             # <<<<<<<<<<<<<<
  *                            self.lock)
  * 
  */
-  __pyx_t_1 = __pyx_f_6mtrand_discd_array(__pyx_v_self->internal_state, rk_geometric, __pyx_v_size, __pyx_v_op, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4157, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_6mtrand_discd_array(__pyx_v_self->internal_state, rk_geometric, __pyx_v_size, __pyx_v_op, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4164, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "mtrand.pyx":4092
+  /* "mtrand.pyx":4099
  *         return discd_array(self.internal_state, rk_zipf, size, oa, self.lock)
  * 
  *     def geometric(self, p, size=None):             # <<<<<<<<<<<<<<
@@ -32527,7 +32590,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_90geometric(struct __pyx_obj_6mt
   return __pyx_r;
 }
 
-/* "mtrand.pyx":4160
+/* "mtrand.pyx":4167
  *                            self.lock)
  * 
  *     def hypergeometric(self, ngood, nbad, nsample, size=None):             # <<<<<<<<<<<<<<
@@ -32537,7 +32600,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_90geometric(struct __pyx_obj_6mt
 
 /* Python wrapper */
 static PyObject *__pyx_pw_6mtrand_11RandomState_93hypergeometric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_92hypergeometric[] = "\n        hypergeometric(ngood, nbad, nsample, size=None)\n\n        Draw samples from a Hypergeometric distribution.\n\n        Samples are drawn from a hypergeometric distribution with specified\n        parameters, ngood (ways to make a good selection), nbad (ways to make\n        a bad selection), and nsample = number of items sampled, which is less\n        than or equal to the sum ngood + nbad.\n\n        Parameters\n        ----------\n        ngood : int or array_like of ints\n            Number of ways to make a good selection.  Must be nonnegative.\n        nbad : int or array_like of ints\n            Number of ways to make a bad selection.  Must be nonnegative.\n        nsample : int or array_like of ints\n            Number of items sampled.  Must be at least 1 and at most\n            ``ngood + nbad``.\n        size : int or tuple of ints, optional\n            Output shape.  If the given shape is, e.g., ``(m, n, k)``, then\n            ``m * n * k`` samples are drawn.  If size is ``None`` (default),\n            a single value is returned if ``ngood``, ``nbad``, and ``nsample``\n            are all scalars.  Otherwise, ``np.broadcast(ngood, nbad, nsample).size``\n            samples are drawn.\n\n        Returns\n        -------\n        out : ndarray or scalar\n            Drawn samples from the parameterized hypergeometric distribution.\n\n        See Also\n        --------\n        scipy.stats.hypergeom : probability density function, distribution or\n            cumulative density function, etc.\n\n        Notes\n        -----\n        The probability density for the Hypergeometric distribution is\n\n        .. math:: P(x) = \\frac{\\binom{g}{x}\\binom{b}{n-x}}{\\binom{g+b}{n}},\n\n        where :math:`0 \\le x \\le n` and :math:`n-b \\le x \\le g`\n\n        for P(x) the probability of x successes, g = ngood, b = nbad, and\n        n = number of samples.\n\n        Consider an urn with black and white marbles in it, ngood of them\n        black a""nd nbad are white. If you draw nsample balls without\n        replacement, then the hypergeometric distribution describes the\n        distribution of black balls in the drawn sample.\n\n        Note that this distribution is very similar to the binomial\n        distribution, except that in this case, samples are drawn without\n        replacement, whereas in the Binomial case samples are drawn with\n        replacement (or the sample space is infinite). As the sample space\n        becomes large, this distribution approaches the binomial.\n\n        References\n        ----------\n        .. [1] Lentner, Marvin, \"Elementary Applied Statistics\", Bogden\n               and Quigley, 1972.\n        .. [2] Weisstein, Eric W. \"Hypergeometric Distribution.\" From\n               MathWorld--A Wolfram Web Resource.\n               http://mathworld.wolfram.com/HypergeometricDistribution.html\n        .. [3] Wikipedia, \"Hypergeometric distribution\",\n               https://en.wikipedia.org/wiki/Hypergeometric_distribution\n\n        Examples\n        --------\n        Draw samples from the distribution:\n\n        >>> ngood, nbad, nsamp = 100, 2, 10\n        # number of good, number of bad, and number of samples\n        >>> s = np.random.hypergeometric(ngood, nbad, nsamp, 1000)\n        >>> hist(s)\n        #   note that it is very unlikely to grab both bad items\n\n        Suppose you have an urn with 15 white and 15 black marbles.\n        If you pull 15 marbles at random, how likely is it that\n        12 or more of them are one color?\n\n        >>> s = np.random.hypergeometric(15, 15, 15, 100000)\n        >>> sum(s>=12)/100000. + sum(s<=3)/100000.\n        #   answer = 0.003 ... pretty unlikely!\n\n        ";
+static char __pyx_doc_6mtrand_11RandomState_92hypergeometric[] = "\n        hypergeometric(ngood, nbad, nsample, size=None)\n\n        Draw samples from a Hypergeometric distribution.\n\n        Samples are drawn from a hypergeometric distribution with specified\n        parameters, ngood (ways to make a good selection), nbad (ways to make\n        a bad selection), and nsample = number of items sampled, which is less\n        than or equal to the sum ngood + nbad.\n\n        Parameters\n        ----------\n        ngood : int or array_like of ints\n            Number of ways to make a good selection.  Must be nonnegative.\n        nbad : int or array_like of ints\n            Number of ways to make a bad selection.  Must be nonnegative.\n        nsample : int or array_like of ints\n            Number of items sampled.  Must be at least 1 and at most\n            ``ngood + nbad``.\n        size : int or tuple of ints, optional\n            Output shape.  If the given shape is, e.g., ``(m, n, k)``, then\n            ``m * n * k`` samples are drawn.  If size is ``None`` (default),\n            a single value is returned if ``ngood``, ``nbad``, and ``nsample``\n            are all scalars.  Otherwise, ``np.broadcast(ngood, nbad, nsample).size``\n            samples are drawn.\n\n        Returns\n        -------\n        out : ndarray or scalar\n            Drawn samples from the parameterized hypergeometric distribution.\n\n        See Also\n        --------\n        scipy.stats.hypergeom : probability density function, distribution or\n            cumulative density function, etc.\n\n        Notes\n        -----\n        The probability density for the Hypergeometric distribution is\n\n        .. math:: P(x) = \\frac{\\binom{g}{x}\\binom{b}{n-x}}{\\binom{g+b}{n}},\n\n        where :math:`0 \\le x \\le n` and :math:`n-b \\le x \\le g`\n\n        for P(x) the probability of x successes, g = ngood, b = nbad, and\n        n = number of samples.\n\n        Consider an urn with black and white marbles in it, ngood of them\n        black a""nd nbad are white. If you draw nsample balls without\n        replacement, then the hypergeometric distribution describes the\n        distribution of black balls in the drawn sample.\n\n        Note that this distribution is very similar to the binomial\n        distribution, except that in this case, samples are drawn without\n        replacement, whereas in the Binomial case samples are drawn with\n        replacement (or the sample space is infinite). As the sample space\n        becomes large, this distribution approaches the binomial.\n\n        References\n        ----------\n        .. [1] Lentner, Marvin, \"Elementary Applied Statistics\", Bogden\n               and Quigley, 1972.\n        .. [2] Weisstein, Eric W. \"Hypergeometric Distribution.\" From\n               MathWorld--A Wolfram Web Resource.\n               http://mathworld.wolfram.com/HypergeometricDistribution.html\n        .. [3] Wikipedia, \"Hypergeometric distribution\",\n               https://en.wikipedia.org/wiki/Hypergeometric_distribution\n\n        Examples\n        --------\n        Draw samples from the distribution:\n\n        >>> ngood, nbad, nsamp = 100, 2, 10\n        # number of good, number of bad, and number of samples\n        >>> s = np.random.hypergeometric(ngood, nbad, nsamp, 1000)\n        >>> from matplotlib.pyplot import hist\n        >>> hist(s)\n        #   note that it is very unlikely to grab both bad items\n\n        Suppose you have an urn with 15 white and 15 black marbles.\n        If you pull 15 marbles at random, how likely is it that\n        12 or more of them are one color?\n\n        >>> s = np.random.hypergeometric(15, 15, 15, 100000)\n        >>> sum(s>=12)/100000. + sum(s<=3)/100000.\n        #   answer = 0.003 ... pretty unlikely!\n\n        ";
 static PyObject *__pyx_pw_6mtrand_11RandomState_93hypergeometric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyObject *__pyx_v_ngood = 0;
   PyObject *__pyx_v_nbad = 0;
@@ -32574,13 +32637,13 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_93hypergeometric(PyObject *__pyx
         case  1:
         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nbad)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("hypergeometric", 0, 3, 4, 1); __PYX_ERR(0, 4160, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("hypergeometric", 0, 3, 4, 1); __PYX_ERR(0, 4167, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  2:
         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nsample)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("hypergeometric", 0, 3, 4, 2); __PYX_ERR(0, 4160, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("hypergeometric", 0, 3, 4, 2); __PYX_ERR(0, 4167, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  3:
@@ -32590,7 +32653,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_93hypergeometric(PyObject *__pyx
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "hypergeometric") < 0)) __PYX_ERR(0, 4160, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "hypergeometric") < 0)) __PYX_ERR(0, 4167, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -32610,7 +32673,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_93hypergeometric(PyObject *__pyx
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("hypergeometric", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4160, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("hypergeometric", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4167, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("mtrand.RandomState.hypergeometric", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -32645,14 +32708,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_92hypergeometric(struct __pyx_ob
   PyObject *__pyx_t_11 = NULL;
   __Pyx_RefNannySetupContext("hypergeometric", 0);
 
-  /* "mtrand.pyx":4251
+  /* "mtrand.pyx":4259
  *         cdef long lngood, lnbad, lnsample
  * 
  *         ongood = <ndarray>PyArray_FROM_OTF(ngood, NPY_LONG, NPY_ARRAY_ALIGNED)             # <<<<<<<<<<<<<<
  *         onbad = <ndarray>PyArray_FROM_OTF(nbad, NPY_LONG, NPY_ARRAY_ALIGNED)
  *         onsample = <ndarray>PyArray_FROM_OTF(nsample, NPY_LONG, NPY_ARRAY_ALIGNED)
  */
-  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_ngood, NPY_LONG, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4251, __pyx_L1_error)
+  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_ngood, NPY_LONG, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4259, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_2 = __pyx_t_1;
   __Pyx_INCREF(__pyx_t_2);
@@ -32660,14 +32723,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_92hypergeometric(struct __pyx_ob
   __pyx_v_ongood = ((PyArrayObject *)__pyx_t_2);
   __pyx_t_2 = 0;
 
-  /* "mtrand.pyx":4252
+  /* "mtrand.pyx":4260
  * 
  *         ongood = <ndarray>PyArray_FROM_OTF(ngood, NPY_LONG, NPY_ARRAY_ALIGNED)
  *         onbad = <ndarray>PyArray_FROM_OTF(nbad, NPY_LONG, NPY_ARRAY_ALIGNED)             # <<<<<<<<<<<<<<
  *         onsample = <ndarray>PyArray_FROM_OTF(nsample, NPY_LONG, NPY_ARRAY_ALIGNED)
  * 
  */
-  __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_nbad, NPY_LONG, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4252, __pyx_L1_error)
+  __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_nbad, NPY_LONG, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4260, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_1 = __pyx_t_2;
   __Pyx_INCREF(__pyx_t_1);
@@ -32675,14 +32738,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_92hypergeometric(struct __pyx_ob
   __pyx_v_onbad = ((PyArrayObject *)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "mtrand.pyx":4253
+  /* "mtrand.pyx":4261
  *         ongood = <ndarray>PyArray_FROM_OTF(ngood, NPY_LONG, NPY_ARRAY_ALIGNED)
  *         onbad = <ndarray>PyArray_FROM_OTF(nbad, NPY_LONG, NPY_ARRAY_ALIGNED)
  *         onsample = <ndarray>PyArray_FROM_OTF(nsample, NPY_LONG, NPY_ARRAY_ALIGNED)             # <<<<<<<<<<<<<<
  * 
  *         if ongood.shape == onbad.shape == onsample.shape == ():
  */
-  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_nsample, NPY_LONG, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4253, __pyx_L1_error)
+  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_nsample, NPY_LONG, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4261, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_2 = __pyx_t_1;
   __Pyx_INCREF(__pyx_t_2);
@@ -32690,66 +32753,66 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_92hypergeometric(struct __pyx_ob
   __pyx_v_onsample = ((PyArrayObject *)__pyx_t_2);
   __pyx_t_2 = 0;
 
-  /* "mtrand.pyx":4255
+  /* "mtrand.pyx":4263
  *         onsample = <ndarray>PyArray_FROM_OTF(nsample, NPY_LONG, NPY_ARRAY_ALIGNED)
  * 
  *         if ongood.shape == onbad.shape == onsample.shape == ():             # <<<<<<<<<<<<<<
  *             lngood = PyInt_AsLong(ngood)
  *             lnbad = PyInt_AsLong(nbad)
  */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ongood), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4255, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ongood), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4263, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_onbad), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4255, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_onbad), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4263, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4255, __pyx_L1_error)
+  __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4263, __pyx_L1_error)
   if (__Pyx_PyObject_IsTrue(__pyx_t_3)) {
     __Pyx_DECREF(__pyx_t_3);
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_onsample), __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4255, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_onsample), __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4263, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4255, __pyx_L1_error)
+    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4263, __pyx_L1_error)
     if (__Pyx_PyObject_IsTrue(__pyx_t_3)) {
       __Pyx_DECREF(__pyx_t_3);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4255, __pyx_L1_error)
+      __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4263, __pyx_L1_error)
     }
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   }
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 4255, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 4263, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   if (__pyx_t_5) {
 
-    /* "mtrand.pyx":4256
+    /* "mtrand.pyx":4264
  * 
  *         if ongood.shape == onbad.shape == onsample.shape == ():
  *             lngood = PyInt_AsLong(ngood)             # <<<<<<<<<<<<<<
  *             lnbad = PyInt_AsLong(nbad)
  *             lnsample = PyInt_AsLong(nsample)
  */
-    __pyx_t_6 = PyInt_AsLong(__pyx_v_ngood); if (unlikely(__pyx_t_6 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(0, 4256, __pyx_L1_error)
+    __pyx_t_6 = PyInt_AsLong(__pyx_v_ngood); if (unlikely(__pyx_t_6 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(0, 4264, __pyx_L1_error)
     __pyx_v_lngood = __pyx_t_6;
 
-    /* "mtrand.pyx":4257
+    /* "mtrand.pyx":4265
  *         if ongood.shape == onbad.shape == onsample.shape == ():
  *             lngood = PyInt_AsLong(ngood)
  *             lnbad = PyInt_AsLong(nbad)             # <<<<<<<<<<<<<<
  *             lnsample = PyInt_AsLong(nsample)
  * 
  */
-    __pyx_t_6 = PyInt_AsLong(__pyx_v_nbad); if (unlikely(__pyx_t_6 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(0, 4257, __pyx_L1_error)
+    __pyx_t_6 = PyInt_AsLong(__pyx_v_nbad); if (unlikely(__pyx_t_6 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(0, 4265, __pyx_L1_error)
     __pyx_v_lnbad = __pyx_t_6;
 
-    /* "mtrand.pyx":4258
+    /* "mtrand.pyx":4266
  *             lngood = PyInt_AsLong(ngood)
  *             lnbad = PyInt_AsLong(nbad)
  *             lnsample = PyInt_AsLong(nsample)             # <<<<<<<<<<<<<<
  * 
  *             if lngood < 0:
  */
-    __pyx_t_6 = PyInt_AsLong(__pyx_v_nsample); if (unlikely(__pyx_t_6 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(0, 4258, __pyx_L1_error)
+    __pyx_t_6 = PyInt_AsLong(__pyx_v_nsample); if (unlikely(__pyx_t_6 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(0, 4266, __pyx_L1_error)
     __pyx_v_lnsample = __pyx_t_6;
 
-    /* "mtrand.pyx":4260
+    /* "mtrand.pyx":4268
  *             lnsample = PyInt_AsLong(nsample)
  * 
  *             if lngood < 0:             # <<<<<<<<<<<<<<
@@ -32759,20 +32822,20 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_92hypergeometric(struct __pyx_ob
     __pyx_t_5 = ((__pyx_v_lngood < 0) != 0);
     if (unlikely(__pyx_t_5)) {
 
-      /* "mtrand.pyx":4261
+      /* "mtrand.pyx":4269
  * 
  *             if lngood < 0:
  *                 raise ValueError("ngood < 0")             # <<<<<<<<<<<<<<
  *             if lnbad < 0:
  *                 raise ValueError("nbad < 0")
  */
-      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4261, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__60, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4269, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __PYX_ERR(0, 4261, __pyx_L1_error)
+      __PYX_ERR(0, 4269, __pyx_L1_error)
 
-      /* "mtrand.pyx":4260
+      /* "mtrand.pyx":4268
  *             lnsample = PyInt_AsLong(nsample)
  * 
  *             if lngood < 0:             # <<<<<<<<<<<<<<
@@ -32781,7 +32844,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_92hypergeometric(struct __pyx_ob
  */
     }
 
-    /* "mtrand.pyx":4262
+    /* "mtrand.pyx":4270
  *             if lngood < 0:
  *                 raise ValueError("ngood < 0")
  *             if lnbad < 0:             # <<<<<<<<<<<<<<
@@ -32791,20 +32854,20 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_92hypergeometric(struct __pyx_ob
     __pyx_t_5 = ((__pyx_v_lnbad < 0) != 0);
     if (unlikely(__pyx_t_5)) {
 
-      /* "mtrand.pyx":4263
+      /* "mtrand.pyx":4271
  *                 raise ValueError("ngood < 0")
  *             if lnbad < 0:
  *                 raise ValueError("nbad < 0")             # <<<<<<<<<<<<<<
  *             if lnsample < 1:
  *                 raise ValueError("nsample < 1")
  */
-      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__60, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4263, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4271, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __PYX_ERR(0, 4263, __pyx_L1_error)
+      __PYX_ERR(0, 4271, __pyx_L1_error)
 
-      /* "mtrand.pyx":4262
+      /* "mtrand.pyx":4270
  *             if lngood < 0:
  *                 raise ValueError("ngood < 0")
  *             if lnbad < 0:             # <<<<<<<<<<<<<<
@@ -32813,7 +32876,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_92hypergeometric(struct __pyx_ob
  */
     }
 
-    /* "mtrand.pyx":4264
+    /* "mtrand.pyx":4272
  *             if lnbad < 0:
  *                 raise ValueError("nbad < 0")
  *             if lnsample < 1:             # <<<<<<<<<<<<<<
@@ -32823,20 +32886,20 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_92hypergeometric(struct __pyx_ob
     __pyx_t_5 = ((__pyx_v_lnsample < 1) != 0);
     if (unlikely(__pyx_t_5)) {
 
-      /* "mtrand.pyx":4265
+      /* "mtrand.pyx":4273
  *                 raise ValueError("nbad < 0")
  *             if lnsample < 1:
  *                 raise ValueError("nsample < 1")             # <<<<<<<<<<<<<<
  *             if lngood + lnbad < lnsample:
  *                 raise ValueError("ngood + nbad < nsample")
  */
-      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4265, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4273, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __PYX_ERR(0, 4265, __pyx_L1_error)
+      __PYX_ERR(0, 4273, __pyx_L1_error)
 
-      /* "mtrand.pyx":4264
+      /* "mtrand.pyx":4272
  *             if lnbad < 0:
  *                 raise ValueError("nbad < 0")
  *             if lnsample < 1:             # <<<<<<<<<<<<<<
@@ -32845,7 +32908,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_92hypergeometric(struct __pyx_ob
  */
     }
 
-    /* "mtrand.pyx":4266
+    /* "mtrand.pyx":4274
  *             if lnsample < 1:
  *                 raise ValueError("nsample < 1")
  *             if lngood + lnbad < lnsample:             # <<<<<<<<<<<<<<
@@ -32855,20 +32918,20 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_92hypergeometric(struct __pyx_ob
     __pyx_t_5 = (((__pyx_v_lngood + __pyx_v_lnbad) < __pyx_v_lnsample) != 0);
     if (unlikely(__pyx_t_5)) {
 
-      /* "mtrand.pyx":4267
+      /* "mtrand.pyx":4275
  *                 raise ValueError("nsample < 1")
  *             if lngood + lnbad < lnsample:
  *                 raise ValueError("ngood + nbad < nsample")             # <<<<<<<<<<<<<<
  *             return discnmN_array_sc(self.internal_state, rk_hypergeometric,
  *                                     size, lngood, lnbad, lnsample, self.lock)
  */
-      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4267, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__63, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4275, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __PYX_ERR(0, 4267, __pyx_L1_error)
+      __PYX_ERR(0, 4275, __pyx_L1_error)
 
-      /* "mtrand.pyx":4266
+      /* "mtrand.pyx":4274
  *             if lnsample < 1:
  *                 raise ValueError("nsample < 1")
  *             if lngood + lnbad < lnsample:             # <<<<<<<<<<<<<<
@@ -32877,7 +32940,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_92hypergeometric(struct __pyx_ob
  */
     }
 
-    /* "mtrand.pyx":4268
+    /* "mtrand.pyx":4276
  *             if lngood + lnbad < lnsample:
  *                 raise ValueError("ngood + nbad < nsample")
  *             return discnmN_array_sc(self.internal_state, rk_hypergeometric,             # <<<<<<<<<<<<<<
@@ -32886,7 +32949,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_92hypergeometric(struct __pyx_ob
  */
     __Pyx_XDECREF(__pyx_r);
 
-    /* "mtrand.pyx":4269
+    /* "mtrand.pyx":4277
  *                 raise ValueError("ngood + nbad < nsample")
  *             return discnmN_array_sc(self.internal_state, rk_hypergeometric,
  *                                     size, lngood, lnbad, lnsample, self.lock)             # <<<<<<<<<<<<<<
@@ -32896,21 +32959,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_92hypergeometric(struct __pyx_ob
     __pyx_t_3 = __pyx_v_self->lock;
     __Pyx_INCREF(__pyx_t_3);
 
-    /* "mtrand.pyx":4268
+    /* "mtrand.pyx":4276
  *             if lngood + lnbad < lnsample:
  *                 raise ValueError("ngood + nbad < nsample")
  *             return discnmN_array_sc(self.internal_state, rk_hypergeometric,             # <<<<<<<<<<<<<<
  *                                     size, lngood, lnbad, lnsample, self.lock)
  * 
  */
-    __pyx_t_1 = __pyx_f_6mtrand_discnmN_array_sc(__pyx_v_self->internal_state, rk_hypergeometric, __pyx_v_size, __pyx_v_lngood, __pyx_v_lnbad, __pyx_v_lnsample, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4268, __pyx_L1_error)
+    __pyx_t_1 = __pyx_f_6mtrand_discnmN_array_sc(__pyx_v_self->internal_state, rk_hypergeometric, __pyx_v_size, __pyx_v_lngood, __pyx_v_lnbad, __pyx_v_lnsample, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4276, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __pyx_r = __pyx_t_1;
     __pyx_t_1 = 0;
     goto __pyx_L0;
 
-    /* "mtrand.pyx":4255
+    /* "mtrand.pyx":4263
  *         onsample = <ndarray>PyArray_FROM_OTF(nsample, NPY_LONG, NPY_ARRAY_ALIGNED)
  * 
  *         if ongood.shape == onbad.shape == onsample.shape == ():             # <<<<<<<<<<<<<<
@@ -32919,21 +32982,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_92hypergeometric(struct __pyx_ob
  */
   }
 
-  /* "mtrand.pyx":4271
+  /* "mtrand.pyx":4279
  *                                     size, lngood, lnbad, lnsample, self.lock)
  * 
  *         if np.any(np.less(ongood, 0)):             # <<<<<<<<<<<<<<
  *             raise ValueError("ngood < 0")
  *         if np.any(np.less(onbad, 0)):
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4271, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4279, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_any); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4271, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_any); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4279, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4271, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4279, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_less); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4271, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_less); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4279, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   __pyx_t_4 = NULL;
@@ -32951,7 +33014,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_92hypergeometric(struct __pyx_ob
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_7)) {
     PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_ongood), __pyx_int_0};
-    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4271, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4279, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_GOTREF(__pyx_t_3);
   } else
@@ -32959,13 +33022,13 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_92hypergeometric(struct __pyx_ob
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
     PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_ongood), __pyx_int_0};
-    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4271, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4279, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_GOTREF(__pyx_t_3);
   } else
   #endif
   {
-    __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4271, __pyx_L1_error)
+    __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4279, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_9);
     if (__pyx_t_4) {
       __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); __pyx_t_4 = NULL;
@@ -32976,7 +33039,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_92hypergeometric(struct __pyx_ob
     __Pyx_INCREF(__pyx_int_0);
     __Pyx_GIVEREF(__pyx_int_0);
     PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_int_0);
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4271, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4279, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
   }
@@ -32994,27 +33057,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_92hypergeometric(struct __pyx_ob
   __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
   __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4271, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4279, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 4271, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 4279, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (unlikely(__pyx_t_5)) {
 
-    /* "mtrand.pyx":4272
+    /* "mtrand.pyx":4280
  * 
  *         if np.any(np.less(ongood, 0)):
  *             raise ValueError("ngood < 0")             # <<<<<<<<<<<<<<
  *         if np.any(np.less(onbad, 0)):
  *             raise ValueError("nbad < 0")
  */
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4272, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__60, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4280, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __PYX_ERR(0, 4272, __pyx_L1_error)
+    __PYX_ERR(0, 4280, __pyx_L1_error)
 
-    /* "mtrand.pyx":4271
+    /* "mtrand.pyx":4279
  *                                     size, lngood, lnbad, lnsample, self.lock)
  * 
  *         if np.any(np.less(ongood, 0)):             # <<<<<<<<<<<<<<
@@ -33023,21 +33086,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_92hypergeometric(struct __pyx_ob
  */
   }
 
-  /* "mtrand.pyx":4273
+  /* "mtrand.pyx":4281
  *         if np.any(np.less(ongood, 0)):
  *             raise ValueError("ngood < 0")
  *         if np.any(np.less(onbad, 0)):             # <<<<<<<<<<<<<<
  *             raise ValueError("nbad < 0")
  *         if np.any(np.less(onsample, 1)):
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4273, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4281, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_any); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4273, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_any); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4281, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4273, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4281, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_less); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4273, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_less); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4281, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   __pyx_t_7 = NULL;
@@ -33055,7 +33118,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_92hypergeometric(struct __pyx_ob
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_9)) {
     PyObject *__pyx_temp[3] = {__pyx_t_7, ((PyObject *)__pyx_v_onbad), __pyx_int_0};
-    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4273, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4281, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
     __Pyx_GOTREF(__pyx_t_2);
   } else
@@ -33063,13 +33126,13 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_92hypergeometric(struct __pyx_ob
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
     PyObject *__pyx_temp[3] = {__pyx_t_7, ((PyObject *)__pyx_v_onbad), __pyx_int_0};
-    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4273, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4281, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
     __Pyx_GOTREF(__pyx_t_2);
   } else
   #endif
   {
-    __pyx_t_4 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4273, __pyx_L1_error)
+    __pyx_t_4 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4281, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     if (__pyx_t_7) {
       __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7); __pyx_t_7 = NULL;
@@ -33080,7 +33143,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_92hypergeometric(struct __pyx_ob
     __Pyx_INCREF(__pyx_int_0);
     __Pyx_GIVEREF(__pyx_int_0);
     PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_8, __pyx_int_0);
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4273, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4281, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   }
@@ -33098,27 +33161,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_92hypergeometric(struct __pyx_ob
   __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_9, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
   __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4273, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4281, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 4273, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 4281, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (unlikely(__pyx_t_5)) {
 
-    /* "mtrand.pyx":4274
+    /* "mtrand.pyx":4282
  *             raise ValueError("ngood < 0")
  *         if np.any(np.less(onbad, 0)):
  *             raise ValueError("nbad < 0")             # <<<<<<<<<<<<<<
  *         if np.any(np.less(onsample, 1)):
  *             raise ValueError("nsample < 1")
  */
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__60, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4274, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4282, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __PYX_ERR(0, 4274, __pyx_L1_error)
+    __PYX_ERR(0, 4282, __pyx_L1_error)
 
-    /* "mtrand.pyx":4273
+    /* "mtrand.pyx":4281
  *         if np.any(np.less(ongood, 0)):
  *             raise ValueError("ngood < 0")
  *         if np.any(np.less(onbad, 0)):             # <<<<<<<<<<<<<<
@@ -33127,21 +33190,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_92hypergeometric(struct __pyx_ob
  */
   }
 
-  /* "mtrand.pyx":4275
+  /* "mtrand.pyx":4283
  *         if np.any(np.less(onbad, 0)):
  *             raise ValueError("nbad < 0")
  *         if np.any(np.less(onsample, 1)):             # <<<<<<<<<<<<<<
  *             raise ValueError("nsample < 1")
  *         if np.any(np.less(np.add(ongood, onbad),onsample)):
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4275, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4283, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_any); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4275, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_any); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4283, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4275, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4283, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_less); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4275, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_less); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4283, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
   __pyx_t_9 = NULL;
@@ -33159,7 +33222,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_92hypergeometric(struct __pyx_ob
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_4)) {
     PyObject *__pyx_temp[3] = {__pyx_t_9, ((PyObject *)__pyx_v_onsample), __pyx_int_1};
-    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4275, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4283, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
     __Pyx_GOTREF(__pyx_t_3);
   } else
@@ -33167,13 +33230,13 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_92hypergeometric(struct __pyx_ob
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
     PyObject *__pyx_temp[3] = {__pyx_t_9, ((PyObject *)__pyx_v_onsample), __pyx_int_1};
-    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4275, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4283, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
     __Pyx_GOTREF(__pyx_t_3);
   } else
   #endif
   {
-    __pyx_t_7 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4275, __pyx_L1_error)
+    __pyx_t_7 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4283, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_7);
     if (__pyx_t_9) {
       __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9); __pyx_t_9 = NULL;
@@ -33184,7 +33247,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_92hypergeometric(struct __pyx_ob
     __Pyx_INCREF(__pyx_int_1);
     __Pyx_GIVEREF(__pyx_int_1);
     PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_int_1);
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4275, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4283, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   }
@@ -33202,27 +33265,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_92hypergeometric(struct __pyx_ob
   __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4275, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4283, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 4275, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 4283, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (unlikely(__pyx_t_5)) {
 
-    /* "mtrand.pyx":4276
+    /* "mtrand.pyx":4284
  *             raise ValueError("nbad < 0")
  *         if np.any(np.less(onsample, 1)):
  *             raise ValueError("nsample < 1")             # <<<<<<<<<<<<<<
  *         if np.any(np.less(np.add(ongood, onbad),onsample)):
  *             raise ValueError("ngood + nbad < nsample")
  */
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4276, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4284, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __PYX_ERR(0, 4276, __pyx_L1_error)
+    __PYX_ERR(0, 4284, __pyx_L1_error)
 
-    /* "mtrand.pyx":4275
+    /* "mtrand.pyx":4283
  *         if np.any(np.less(onbad, 0)):
  *             raise ValueError("nbad < 0")
  *         if np.any(np.less(onsample, 1)):             # <<<<<<<<<<<<<<
@@ -33231,26 +33294,26 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_92hypergeometric(struct __pyx_ob
  */
   }
 
-  /* "mtrand.pyx":4277
+  /* "mtrand.pyx":4285
  *         if np.any(np.less(onsample, 1)):
  *             raise ValueError("nsample < 1")
  *         if np.any(np.less(np.add(ongood, onbad),onsample)):             # <<<<<<<<<<<<<<
  *             raise ValueError("ngood + nbad < nsample")
  *         return discnmN_array(self.internal_state, rk_hypergeometric, size,
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4277, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4285, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_any); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4277, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_any); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4285, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4277, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4285, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_less); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4277, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_less); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4285, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4277, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4285, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_add); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4277, __pyx_L1_error)
+  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_add); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4285, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_10);
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
   __pyx_t_9 = NULL;
@@ -33268,7 +33331,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_92hypergeometric(struct __pyx_ob
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_10)) {
     PyObject *__pyx_temp[3] = {__pyx_t_9, ((PyObject *)__pyx_v_ongood), ((PyObject *)__pyx_v_onbad)};
-    __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4277, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4285, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
     __Pyx_GOTREF(__pyx_t_4);
   } else
@@ -33276,13 +33339,13 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_92hypergeometric(struct __pyx_ob
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
     PyObject *__pyx_temp[3] = {__pyx_t_9, ((PyObject *)__pyx_v_ongood), ((PyObject *)__pyx_v_onbad)};
-    __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4277, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4285, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
     __Pyx_GOTREF(__pyx_t_4);
   } else
   #endif
   {
-    __pyx_t_11 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4277, __pyx_L1_error)
+    __pyx_t_11 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4285, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_11);
     if (__pyx_t_9) {
       __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
@@ -33293,7 +33356,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_92hypergeometric(struct __pyx_ob
     __Pyx_INCREF(((PyObject *)__pyx_v_onbad));
     __Pyx_GIVEREF(((PyObject *)__pyx_v_onbad));
     PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_8, ((PyObject *)__pyx_v_onbad));
-    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4277, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4285, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
   }
@@ -33313,7 +33376,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_92hypergeometric(struct __pyx_ob
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_7)) {
     PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_4, ((PyObject *)__pyx_v_onsample)};
-    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4277, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4285, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
@@ -33322,14 +33385,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_92hypergeometric(struct __pyx_ob
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
     PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_4, ((PyObject *)__pyx_v_onsample)};
-    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4277, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4285, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   } else
   #endif
   {
-    __pyx_t_11 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4277, __pyx_L1_error)
+    __pyx_t_11 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4285, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_11);
     if (__pyx_t_10) {
       __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL;
@@ -33340,7 +33403,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_92hypergeometric(struct __pyx_ob
     __Pyx_GIVEREF(((PyObject *)__pyx_v_onsample));
     PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_8, ((PyObject *)__pyx_v_onsample));
     __pyx_t_4 = 0;
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4277, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4285, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
   }
@@ -33358,27 +33421,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_92hypergeometric(struct __pyx_ob
   __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_7, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
   __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4277, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4285, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 4277, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 4285, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (unlikely(__pyx_t_5)) {
 
-    /* "mtrand.pyx":4278
+    /* "mtrand.pyx":4286
  *             raise ValueError("nsample < 1")
  *         if np.any(np.less(np.add(ongood, onbad),onsample)):
  *             raise ValueError("ngood + nbad < nsample")             # <<<<<<<<<<<<<<
  *         return discnmN_array(self.internal_state, rk_hypergeometric, size,
  *                              ongood, onbad, onsample, self.lock)
  */
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4278, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__63, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4286, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __PYX_ERR(0, 4278, __pyx_L1_error)
+    __PYX_ERR(0, 4286, __pyx_L1_error)
 
-    /* "mtrand.pyx":4277
+    /* "mtrand.pyx":4285
  *         if np.any(np.less(onsample, 1)):
  *             raise ValueError("nsample < 1")
  *         if np.any(np.less(np.add(ongood, onbad),onsample)):             # <<<<<<<<<<<<<<
@@ -33387,7 +33450,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_92hypergeometric(struct __pyx_ob
  */
   }
 
-  /* "mtrand.pyx":4279
+  /* "mtrand.pyx":4287
  *         if np.any(np.less(np.add(ongood, onbad),onsample)):
  *             raise ValueError("ngood + nbad < nsample")
  *         return discnmN_array(self.internal_state, rk_hypergeometric, size,             # <<<<<<<<<<<<<<
@@ -33396,7 +33459,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_92hypergeometric(struct __pyx_ob
  */
   __Pyx_XDECREF(__pyx_r);
 
-  /* "mtrand.pyx":4280
+  /* "mtrand.pyx":4288
  *             raise ValueError("ngood + nbad < nsample")
  *         return discnmN_array(self.internal_state, rk_hypergeometric, size,
  *                              ongood, onbad, onsample, self.lock)             # <<<<<<<<<<<<<<
@@ -33406,21 +33469,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_92hypergeometric(struct __pyx_ob
   __pyx_t_1 = __pyx_v_self->lock;
   __Pyx_INCREF(__pyx_t_1);
 
-  /* "mtrand.pyx":4279
+  /* "mtrand.pyx":4287
  *         if np.any(np.less(np.add(ongood, onbad),onsample)):
  *             raise ValueError("ngood + nbad < nsample")
  *         return discnmN_array(self.internal_state, rk_hypergeometric, size,             # <<<<<<<<<<<<<<
  *                              ongood, onbad, onsample, self.lock)
  * 
  */
-  __pyx_t_3 = __pyx_f_6mtrand_discnmN_array(__pyx_v_self->internal_state, rk_hypergeometric, __pyx_v_size, __pyx_v_ongood, __pyx_v_onbad, __pyx_v_onsample, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4279, __pyx_L1_error)
+  __pyx_t_3 = __pyx_f_6mtrand_discnmN_array(__pyx_v_self->internal_state, rk_hypergeometric, __pyx_v_size, __pyx_v_ongood, __pyx_v_onbad, __pyx_v_onsample, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4287, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_r = __pyx_t_3;
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  /* "mtrand.pyx":4160
+  /* "mtrand.pyx":4167
  *                            self.lock)
  * 
  *     def hypergeometric(self, ngood, nbad, nsample, size=None):             # <<<<<<<<<<<<<<
@@ -33449,7 +33512,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_92hypergeometric(struct __pyx_ob
   return __pyx_r;
 }
 
-/* "mtrand.pyx":4282
+/* "mtrand.pyx":4290
  *                              ongood, onbad, onsample, self.lock)
  * 
  *     def logseries(self, p, size=None):             # <<<<<<<<<<<<<<
@@ -33459,7 +33522,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_92hypergeometric(struct __pyx_ob
 
 /* Python wrapper */
 static PyObject *__pyx_pw_6mtrand_11RandomState_95logseries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_94logseries[] = "\n        logseries(p, size=None)\n\n        Draw samples from a logarithmic series distribution.\n\n        Samples are drawn from a log series distribution with specified\n        shape parameter, 0 < ``p`` < 1.\n\n        Parameters\n        ----------\n        p : float or array_like of floats\n            Shape parameter for the distribution.  Must be in the range (0, 1).\n        size : int or tuple of ints, optional\n            Output shape.  If the given shape is, e.g., ``(m, n, k)``, then\n            ``m * n * k`` samples are drawn.  If size is ``None`` (default),\n            a single value is returned if ``p`` is a scalar.  Otherwise,\n            ``np.array(p).size`` samples are drawn.\n\n        Returns\n        -------\n        out : ndarray or scalar\n            Drawn samples from the parameterized logarithmic series distribution.\n\n        See Also\n        --------\n        scipy.stats.logser : probability density function, distribution or\n            cumulative density function, etc.\n\n        Notes\n        -----\n        The probability density for the Log Series distribution is\n\n        .. math:: P(k) = \\frac{-p^k}{k \\ln(1-p)},\n\n        where p = probability.\n\n        The log series distribution is frequently used to represent species\n        richness and occurrence, first proposed by Fisher, Corbet, and\n        Williams in 1943 [2].  It may also be used to model the numbers of\n        occupants seen in cars [3].\n\n        References\n        ----------\n        .. [1] Buzas, Martin A.; Culver, Stephen J.,  Understanding regional\n               species diversity through the log series distribution of\n               occurrences: BIODIVERSITY RESEARCH Diversity & Distributions,\n               Volume 5, Number 5, September 1999 , pp. 187-195(9).\n        .. [2] Fisher, R.A,, A.S. Corbet, and C.B. Williams. 1943. The\n               relation between the number of species and the number of\n               individuals in a random ""sample of an animal population.\n               Journal of Animal Ecology, 12:42-58.\n        .. [3] D. J. Hand, F. Daly, D. Lunn, E. Ostrowski, A Handbook of Small\n               Data Sets, CRC Press, 1994.\n        .. [4] Wikipedia, \"Logarithmic distribution\",\n               https://en.wikipedia.org/wiki/Logarithmic_distribution\n\n        Examples\n        --------\n        Draw samples from the distribution:\n\n        >>> a = .6\n        >>> s = np.random.logseries(a, 10000)\n        >>> count, bins, ignored = plt.hist(s)\n\n        #   plot against distribution\n\n        >>> def logseries(k, p):\n        ...     return -p**k/(k*log(1-p))\n        >>> plt.plot(bins, logseries(bins, a)*count.max()/\n                     logseries(bins, a).max(), 'r')\n        >>> plt.show()\n\n        ";
+static char __pyx_doc_6mtrand_11RandomState_94logseries[] = "\n        logseries(p, size=None)\n\n        Draw samples from a logarithmic series distribution.\n\n        Samples are drawn from a log series distribution with specified\n        shape parameter, 0 < ``p`` < 1.\n\n        Parameters\n        ----------\n        p : float or array_like of floats\n            Shape parameter for the distribution.  Must be in the range (0, 1).\n        size : int or tuple of ints, optional\n            Output shape.  If the given shape is, e.g., ``(m, n, k)``, then\n            ``m * n * k`` samples are drawn.  If size is ``None`` (default),\n            a single value is returned if ``p`` is a scalar.  Otherwise,\n            ``np.array(p).size`` samples are drawn.\n\n        Returns\n        -------\n        out : ndarray or scalar\n            Drawn samples from the parameterized logarithmic series distribution.\n\n        See Also\n        --------\n        scipy.stats.logser : probability density function, distribution or\n            cumulative density function, etc.\n\n        Notes\n        -----\n        The probability density for the Log Series distribution is\n\n        .. math:: P(k) = \\frac{-p^k}{k \\ln(1-p)},\n\n        where p = probability.\n\n        The log series distribution is frequently used to represent species\n        richness and occurrence, first proposed by Fisher, Corbet, and\n        Williams in 1943 [2].  It may also be used to model the numbers of\n        occupants seen in cars [3].\n\n        References\n        ----------\n        .. [1] Buzas, Martin A.; Culver, Stephen J.,  Understanding regional\n               species diversity through the log series distribution of\n               occurrences: BIODIVERSITY RESEARCH Diversity & Distributions,\n               Volume 5, Number 5, September 1999 , pp. 187-195(9).\n        .. [2] Fisher, R.A,, A.S. Corbet, and C.B. Williams. 1943. The\n               relation between the number of species and the number of\n               individuals in a random ""sample of an animal population.\n               Journal of Animal Ecology, 12:42-58.\n        .. [3] D. J. Hand, F. Daly, D. Lunn, E. Ostrowski, A Handbook of Small\n               Data Sets, CRC Press, 1994.\n        .. [4] Wikipedia, \"Logarithmic distribution\",\n               https://en.wikipedia.org/wiki/Logarithmic_distribution\n\n        Examples\n        --------\n        Draw samples from the distribution:\n\n        >>> a = .6\n        >>> s = np.random.logseries(a, 10000)\n        >>> import matplotlib.pyplot as plt\n        >>> count, bins, ignored = plt.hist(s)\n\n        #   plot against distribution\n\n        >>> def logseries(k, p):\n        ...     return -p**k/(k*log(1-p))\n        >>> plt.plot(bins, logseries(bins, a)*count.max()/\n                     logseries(bins, a).max(), 'r')\n        >>> plt.show()\n\n        ";
 static PyObject *__pyx_pw_6mtrand_11RandomState_95logseries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyObject *__pyx_v_p = 0;
   PyObject *__pyx_v_size = 0;
@@ -33494,7 +33557,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_95logseries(PyObject *__pyx_v_se
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "logseries") < 0)) __PYX_ERR(0, 4282, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "logseries") < 0)) __PYX_ERR(0, 4290, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -33510,7 +33573,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_95logseries(PyObject *__pyx_v_se
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("logseries", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4282, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("logseries", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4290, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("mtrand.RandomState.logseries", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -33539,14 +33602,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_94logseries(struct __pyx_obj_6mt
   PyObject *__pyx_t_9 = NULL;
   __Pyx_RefNannySetupContext("logseries", 0);
 
-  /* "mtrand.pyx":4359
+  /* "mtrand.pyx":4368
  *         cdef double fp
  * 
  *         op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ARRAY_ALIGNED)             # <<<<<<<<<<<<<<
  * 
  *         if op.shape == ():
  */
-  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_p, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4359, __pyx_L1_error)
+  __pyx_t_1 = PyArray_FROM_OTF(__pyx_v_p, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4368, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_2 = __pyx_t_1;
   __Pyx_INCREF(__pyx_t_2);
@@ -33554,32 +33617,32 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_94logseries(struct __pyx_obj_6mt
   __pyx_v_op = ((PyArrayObject *)__pyx_t_2);
   __pyx_t_2 = 0;
 
-  /* "mtrand.pyx":4361
+  /* "mtrand.pyx":4370
  *         op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if op.shape == ():             # <<<<<<<<<<<<<<
  *             fp = PyFloat_AsDouble(p)
  * 
  */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_op), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4361, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_op), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4370, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4361, __pyx_L1_error)
+  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4370, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 4361, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 4370, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (__pyx_t_3) {
 
-    /* "mtrand.pyx":4362
+    /* "mtrand.pyx":4371
  * 
  *         if op.shape == ():
  *             fp = PyFloat_AsDouble(p)             # <<<<<<<<<<<<<<
  * 
  *             if fp <= 0.0:
  */
-    __pyx_t_4 = PyFloat_AsDouble(__pyx_v_p); if (unlikely(__pyx_t_4 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 4362, __pyx_L1_error)
+    __pyx_t_4 = PyFloat_AsDouble(__pyx_v_p); if (unlikely(__pyx_t_4 == ((double)(-1.0)) && PyErr_Occurred())) __PYX_ERR(0, 4371, __pyx_L1_error)
     __pyx_v_fp = __pyx_t_4;
 
-    /* "mtrand.pyx":4364
+    /* "mtrand.pyx":4373
  *             fp = PyFloat_AsDouble(p)
  * 
  *             if fp <= 0.0:             # <<<<<<<<<<<<<<
@@ -33589,20 +33652,20 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_94logseries(struct __pyx_obj_6mt
     __pyx_t_3 = ((__pyx_v_fp <= 0.0) != 0);
     if (unlikely(__pyx_t_3)) {
 
-      /* "mtrand.pyx":4365
+      /* "mtrand.pyx":4374
  * 
  *             if fp <= 0.0:
  *                 raise ValueError("p <= 0.0")             # <<<<<<<<<<<<<<
  *             if fp >= 1.0:
  *                 raise ValueError("p >= 1.0")
  */
-      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4365, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4374, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_Raise(__pyx_t_1, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __PYX_ERR(0, 4365, __pyx_L1_error)
+      __PYX_ERR(0, 4374, __pyx_L1_error)
 
-      /* "mtrand.pyx":4364
+      /* "mtrand.pyx":4373
  *             fp = PyFloat_AsDouble(p)
  * 
  *             if fp <= 0.0:             # <<<<<<<<<<<<<<
@@ -33611,7 +33674,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_94logseries(struct __pyx_obj_6mt
  */
     }
 
-    /* "mtrand.pyx":4366
+    /* "mtrand.pyx":4375
  *             if fp <= 0.0:
  *                 raise ValueError("p <= 0.0")
  *             if fp >= 1.0:             # <<<<<<<<<<<<<<
@@ -33621,20 +33684,20 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_94logseries(struct __pyx_obj_6mt
     __pyx_t_3 = ((__pyx_v_fp >= 1.0) != 0);
     if (unlikely(__pyx_t_3)) {
 
-      /* "mtrand.pyx":4367
+      /* "mtrand.pyx":4376
  *                 raise ValueError("p <= 0.0")
  *             if fp >= 1.0:
  *                 raise ValueError("p >= 1.0")             # <<<<<<<<<<<<<<
  *             return discd_array_sc(self.internal_state, rk_logseries, size, fp,
  *                                   self.lock)
  */
-      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__63, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4367, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__64, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4376, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_Raise(__pyx_t_1, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __PYX_ERR(0, 4367, __pyx_L1_error)
+      __PYX_ERR(0, 4376, __pyx_L1_error)
 
-      /* "mtrand.pyx":4366
+      /* "mtrand.pyx":4375
  *             if fp <= 0.0:
  *                 raise ValueError("p <= 0.0")
  *             if fp >= 1.0:             # <<<<<<<<<<<<<<
@@ -33643,7 +33706,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_94logseries(struct __pyx_obj_6mt
  */
     }
 
-    /* "mtrand.pyx":4368
+    /* "mtrand.pyx":4377
  *             if fp >= 1.0:
  *                 raise ValueError("p >= 1.0")
  *             return discd_array_sc(self.internal_state, rk_logseries, size, fp,             # <<<<<<<<<<<<<<
@@ -33652,7 +33715,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_94logseries(struct __pyx_obj_6mt
  */
     __Pyx_XDECREF(__pyx_r);
 
-    /* "mtrand.pyx":4369
+    /* "mtrand.pyx":4378
  *                 raise ValueError("p >= 1.0")
  *             return discd_array_sc(self.internal_state, rk_logseries, size, fp,
  *                                   self.lock)             # <<<<<<<<<<<<<<
@@ -33662,21 +33725,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_94logseries(struct __pyx_obj_6mt
     __pyx_t_1 = __pyx_v_self->lock;
     __Pyx_INCREF(__pyx_t_1);
 
-    /* "mtrand.pyx":4368
+    /* "mtrand.pyx":4377
  *             if fp >= 1.0:
  *                 raise ValueError("p >= 1.0")
  *             return discd_array_sc(self.internal_state, rk_logseries, size, fp,             # <<<<<<<<<<<<<<
  *                                   self.lock)
  * 
  */
-    __pyx_t_2 = __pyx_f_6mtrand_discd_array_sc(__pyx_v_self->internal_state, rk_logseries, __pyx_v_size, __pyx_v_fp, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4368, __pyx_L1_error)
+    __pyx_t_2 = __pyx_f_6mtrand_discd_array_sc(__pyx_v_self->internal_state, rk_logseries, __pyx_v_size, __pyx_v_fp, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4377, __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;
 
-    /* "mtrand.pyx":4361
+    /* "mtrand.pyx":4370
  *         op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
  * 
  *         if op.shape == ():             # <<<<<<<<<<<<<<
@@ -33685,21 +33748,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_94logseries(struct __pyx_obj_6mt
  */
   }
 
-  /* "mtrand.pyx":4371
+  /* "mtrand.pyx":4380
  *                                   self.lock)
  * 
  *         if np.any(np.less_equal(op, 0.0)):             # <<<<<<<<<<<<<<
  *             raise ValueError("p <= 0.0")
  *         if np.any(np.greater_equal(op, 1.0)):
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4371, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4380, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_any); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4371, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_any); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4380, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4371, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4380, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_less_equal); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4371, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_less_equal); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4380, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   __pyx_t_6 = NULL;
@@ -33717,7 +33780,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_94logseries(struct __pyx_obj_6mt
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_7)) {
     PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_v_op), __pyx_float_0_0};
-    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4371, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4380, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
@@ -33725,13 +33788,13 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_94logseries(struct __pyx_obj_6mt
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
     PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_v_op), __pyx_float_0_0};
-    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4371, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4380, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
   #endif
   {
-    __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4371, __pyx_L1_error)
+    __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4380, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_9);
     if (__pyx_t_6) {
       __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL;
@@ -33742,7 +33805,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_94logseries(struct __pyx_obj_6mt
     __Pyx_INCREF(__pyx_float_0_0);
     __Pyx_GIVEREF(__pyx_float_0_0);
     PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_float_0_0);
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4371, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4380, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
   }
@@ -33760,27 +33823,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_94logseries(struct __pyx_obj_6mt
   __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1);
   __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4371, __pyx_L1_error)
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4380, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 4371, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 4380, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (unlikely(__pyx_t_3)) {
 
-    /* "mtrand.pyx":4372
+    /* "mtrand.pyx":4381
  * 
  *         if np.any(np.less_equal(op, 0.0)):
  *             raise ValueError("p <= 0.0")             # <<<<<<<<<<<<<<
  *         if np.any(np.greater_equal(op, 1.0)):
  *             raise ValueError("p >= 1.0")
  */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4372, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4381, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __PYX_ERR(0, 4372, __pyx_L1_error)
+    __PYX_ERR(0, 4381, __pyx_L1_error)
 
-    /* "mtrand.pyx":4371
+    /* "mtrand.pyx":4380
  *                                   self.lock)
  * 
  *         if np.any(np.less_equal(op, 0.0)):             # <<<<<<<<<<<<<<
@@ -33789,21 +33852,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_94logseries(struct __pyx_obj_6mt
  */
   }
 
-  /* "mtrand.pyx":4373
+  /* "mtrand.pyx":4382
  *         if np.any(np.less_equal(op, 0.0)):
  *             raise ValueError("p <= 0.0")
  *         if np.any(np.greater_equal(op, 1.0)):             # <<<<<<<<<<<<<<
  *             raise ValueError("p >= 1.0")
  *         return discd_array(self.internal_state, rk_logseries, size, op,
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4373, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4382, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_any); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4373, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_any); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4382, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4373, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4382, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_greater_equal); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4373, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_greater_equal); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4382, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   __pyx_t_7 = NULL;
@@ -33821,7 +33884,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_94logseries(struct __pyx_obj_6mt
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_9)) {
     PyObject *__pyx_temp[3] = {__pyx_t_7, ((PyObject *)__pyx_v_op), __pyx_float_1_0};
-    __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4373, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4382, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
     __Pyx_GOTREF(__pyx_t_5);
   } else
@@ -33829,13 +33892,13 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_94logseries(struct __pyx_obj_6mt
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
     PyObject *__pyx_temp[3] = {__pyx_t_7, ((PyObject *)__pyx_v_op), __pyx_float_1_0};
-    __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4373, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4382, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
     __Pyx_GOTREF(__pyx_t_5);
   } else
   #endif
   {
-    __pyx_t_6 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4373, __pyx_L1_error)
+    __pyx_t_6 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4382, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     if (__pyx_t_7) {
       __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = NULL;
@@ -33846,7 +33909,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_94logseries(struct __pyx_obj_6mt
     __Pyx_INCREF(__pyx_float_1_0);
     __Pyx_GIVEREF(__pyx_float_1_0);
     PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_float_1_0);
-    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4373, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4382, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   }
@@ -33864,27 +33927,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_94logseries(struct __pyx_obj_6mt
   __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_9, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5);
   __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4373, __pyx_L1_error)
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4382, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 4373, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 4382, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (unlikely(__pyx_t_3)) {
 
-    /* "mtrand.pyx":4374
+    /* "mtrand.pyx":4383
  *             raise ValueError("p <= 0.0")
  *         if np.any(np.greater_equal(op, 1.0)):
  *             raise ValueError("p >= 1.0")             # <<<<<<<<<<<<<<
  *         return discd_array(self.internal_state, rk_logseries, size, op,
  *                            self.lock)
  */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__63, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4374, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__64, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4383, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __PYX_ERR(0, 4374, __pyx_L1_error)
+    __PYX_ERR(0, 4383, __pyx_L1_error)
 
-    /* "mtrand.pyx":4373
+    /* "mtrand.pyx":4382
  *         if np.any(np.less_equal(op, 0.0)):
  *             raise ValueError("p <= 0.0")
  *         if np.any(np.greater_equal(op, 1.0)):             # <<<<<<<<<<<<<<
@@ -33893,7 +33956,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_94logseries(struct __pyx_obj_6mt
  */
   }
 
-  /* "mtrand.pyx":4375
+  /* "mtrand.pyx":4384
  *         if np.any(np.greater_equal(op, 1.0)):
  *             raise ValueError("p >= 1.0")
  *         return discd_array(self.internal_state, rk_logseries, size, op,             # <<<<<<<<<<<<<<
@@ -33902,7 +33965,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_94logseries(struct __pyx_obj_6mt
  */
   __Pyx_XDECREF(__pyx_r);
 
-  /* "mtrand.pyx":4376
+  /* "mtrand.pyx":4385
  *             raise ValueError("p >= 1.0")
  *         return discd_array(self.internal_state, rk_logseries, size, op,
  *                            self.lock)             # <<<<<<<<<<<<<<
@@ -33912,21 +33975,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_94logseries(struct __pyx_obj_6mt
   __pyx_t_2 = __pyx_v_self->lock;
   __Pyx_INCREF(__pyx_t_2);
 
-  /* "mtrand.pyx":4375
+  /* "mtrand.pyx":4384
  *         if np.any(np.greater_equal(op, 1.0)):
  *             raise ValueError("p >= 1.0")
  *         return discd_array(self.internal_state, rk_logseries, size, op,             # <<<<<<<<<<<<<<
  *                            self.lock)
  * 
  */
-  __pyx_t_1 = __pyx_f_6mtrand_discd_array(__pyx_v_self->internal_state, rk_logseries, __pyx_v_size, __pyx_v_op, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4375, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_6mtrand_discd_array(__pyx_v_self->internal_state, rk_logseries, __pyx_v_size, __pyx_v_op, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4384, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "mtrand.pyx":4282
+  /* "mtrand.pyx":4290
  *                              ongood, onbad, onsample, self.lock)
  * 
  *     def logseries(self, p, size=None):             # <<<<<<<<<<<<<<
@@ -33951,7 +34014,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_94logseries(struct __pyx_obj_6mt
   return __pyx_r;
 }
 
-/* "mtrand.pyx":4379
+/* "mtrand.pyx":4388
  * 
  *     # Multivariate distributions:
  *     def multivariate_normal(self, mean, cov, size=None, check_valid='warn',             # <<<<<<<<<<<<<<
@@ -34003,7 +34066,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_97multivariate_normal(PyObject *
         case  1:
         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cov)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("multivariate_normal", 0, 2, 5, 1); __PYX_ERR(0, 4379, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("multivariate_normal", 0, 2, 5, 1); __PYX_ERR(0, 4388, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  2:
@@ -34025,7 +34088,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_97multivariate_normal(PyObject *
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "multivariate_normal") < 0)) __PYX_ERR(0, 4379, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "multivariate_normal") < 0)) __PYX_ERR(0, 4388, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -34049,7 +34112,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_97multivariate_normal(PyObject *
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("multivariate_normal", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4379, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("multivariate_normal", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4388, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("mtrand.RandomState.multivariate_normal", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -34090,38 +34153,38 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_96multivariate_normal(struct __p
   __Pyx_INCREF(__pyx_v_mean);
   __Pyx_INCREF(__pyx_v_cov);
 
-  /* "mtrand.pyx":4480
+  /* "mtrand.pyx":4489
  * 
  *         """
  *         from numpy.dual import svd             # <<<<<<<<<<<<<<
  * 
  *         # Check preconditions on arguments
  */
-  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4480, __pyx_L1_error)
+  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4489, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_INCREF(__pyx_n_s_svd);
   __Pyx_GIVEREF(__pyx_n_s_svd);
   PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_svd);
-  __pyx_t_2 = __Pyx_Import(__pyx_n_s_numpy_dual, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4480, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_numpy_dual, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4489, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_svd); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4480, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_svd); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4489, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_INCREF(__pyx_t_1);
   __pyx_v_svd = __pyx_t_1;
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "mtrand.pyx":4483
+  /* "mtrand.pyx":4492
  * 
  *         # Check preconditions on arguments
  *         mean = np.array(mean)             # <<<<<<<<<<<<<<
  *         cov = np.array(cov)
  *         if size is None:
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4483, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4492, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4483, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4492, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_t_1 = NULL;
@@ -34136,22 +34199,22 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_96multivariate_normal(struct __p
   }
   __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_v_mean) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_mean);
   __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4483, __pyx_L1_error)
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4492, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __Pyx_DECREF_SET(__pyx_v_mean, __pyx_t_2);
   __pyx_t_2 = 0;
 
-  /* "mtrand.pyx":4484
+  /* "mtrand.pyx":4493
  *         # Check preconditions on arguments
  *         mean = np.array(mean)
  *         cov = np.array(cov)             # <<<<<<<<<<<<<<
  *         if size is None:
  *             shape = []
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4484, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4493, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4484, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4493, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __pyx_t_3 = NULL;
@@ -34166,13 +34229,13 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_96multivariate_normal(struct __p
   }
   __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_v_cov) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_cov);
   __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4484, __pyx_L1_error)
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4493, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF_SET(__pyx_v_cov, __pyx_t_2);
   __pyx_t_2 = 0;
 
-  /* "mtrand.pyx":4485
+  /* "mtrand.pyx":4494
  *         mean = np.array(mean)
  *         cov = np.array(cov)
  *         if size is None:             # <<<<<<<<<<<<<<
@@ -34183,19 +34246,19 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_96multivariate_normal(struct __p
   __pyx_t_5 = (__pyx_t_4 != 0);
   if (__pyx_t_5) {
 
-    /* "mtrand.pyx":4486
+    /* "mtrand.pyx":4495
  *         cov = np.array(cov)
  *         if size is None:
  *             shape = []             # <<<<<<<<<<<<<<
  *         elif isinstance(size, (int, long, np.integer)):
  *             shape = [size]
  */
-    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4486, __pyx_L1_error)
+    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4495, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_v_shape = __pyx_t_2;
     __pyx_t_2 = 0;
 
-    /* "mtrand.pyx":4485
+    /* "mtrand.pyx":4494
  *         mean = np.array(mean)
  *         cov = np.array(cov)
  *         if size is None:             # <<<<<<<<<<<<<<
@@ -34205,16 +34268,16 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_96multivariate_normal(struct __p
     goto __pyx_L3;
   }
 
-  /* "mtrand.pyx":4487
+  /* "mtrand.pyx":4496
  *         if size is None:
  *             shape = []
  *         elif isinstance(size, (int, long, np.integer)):             # <<<<<<<<<<<<<<
  *             shape = [size]
  *         else:
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4487, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4496, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_integer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4487, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_integer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4496, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_t_4 = PyInt_Check(__pyx_v_size); 
@@ -34239,14 +34302,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_96multivariate_normal(struct __p
   __pyx_t_6 = (__pyx_t_5 != 0);
   if (__pyx_t_6) {
 
-    /* "mtrand.pyx":4488
+    /* "mtrand.pyx":4497
  *             shape = []
  *         elif isinstance(size, (int, long, np.integer)):
  *             shape = [size]             # <<<<<<<<<<<<<<
  *         else:
  *             shape = size
  */
-    __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4488, __pyx_L1_error)
+    __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4497, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_INCREF(__pyx_v_size);
     __Pyx_GIVEREF(__pyx_v_size);
@@ -34254,7 +34317,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_96multivariate_normal(struct __p
     __pyx_v_shape = __pyx_t_1;
     __pyx_t_1 = 0;
 
-    /* "mtrand.pyx":4487
+    /* "mtrand.pyx":4496
  *         if size is None:
  *             shape = []
  *         elif isinstance(size, (int, long, np.integer)):             # <<<<<<<<<<<<<<
@@ -34264,7 +34327,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_96multivariate_normal(struct __p
     goto __pyx_L3;
   }
 
-  /* "mtrand.pyx":4490
+  /* "mtrand.pyx":4499
  *             shape = [size]
  *         else:
  *             shape = size             # <<<<<<<<<<<<<<
@@ -34277,34 +34340,34 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_96multivariate_normal(struct __p
   }
   __pyx_L3:;
 
-  /* "mtrand.pyx":4492
+  /* "mtrand.pyx":4501
  *             shape = size
  * 
  *         if len(mean.shape) != 1:             # <<<<<<<<<<<<<<
  *             raise ValueError("mean must be 1 dimensional")
  *         if (len(cov.shape) != 2) or (cov.shape[0] != cov.shape[1]):
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mean, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4492, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mean, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4501, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_7 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 4492, __pyx_L1_error)
+  __pyx_t_7 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 4501, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_t_6 = ((__pyx_t_7 != 1) != 0);
   if (unlikely(__pyx_t_6)) {
 
-    /* "mtrand.pyx":4493
+    /* "mtrand.pyx":4502
  * 
  *         if len(mean.shape) != 1:
  *             raise ValueError("mean must be 1 dimensional")             # <<<<<<<<<<<<<<
  *         if (len(cov.shape) != 2) or (cov.shape[0] != cov.shape[1]):
  *             raise ValueError("cov must be 2 dimensional and square")
  */
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__64, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4493, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4502, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __PYX_ERR(0, 4493, __pyx_L1_error)
+    __PYX_ERR(0, 4502, __pyx_L1_error)
 
-    /* "mtrand.pyx":4492
+    /* "mtrand.pyx":4501
  *             shape = size
  * 
  *         if len(mean.shape) != 1:             # <<<<<<<<<<<<<<
@@ -34313,16 +34376,16 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_96multivariate_normal(struct __p
  */
   }
 
-  /* "mtrand.pyx":4494
+  /* "mtrand.pyx":4503
  *         if len(mean.shape) != 1:
  *             raise ValueError("mean must be 1 dimensional")
  *         if (len(cov.shape) != 2) or (cov.shape[0] != cov.shape[1]):             # <<<<<<<<<<<<<<
  *             raise ValueError("cov must be 2 dimensional and square")
  *         if mean.shape[0] != cov.shape[0]:
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cov, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4494, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cov, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4503, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_7 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 4494, __pyx_L1_error)
+  __pyx_t_7 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 4503, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_t_5 = ((__pyx_t_7 != 2) != 0);
   if (!__pyx_t_5) {
@@ -34330,39 +34393,39 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_96multivariate_normal(struct __p
     __pyx_t_6 = __pyx_t_5;
     goto __pyx_L9_bool_binop_done;
   }
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cov, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4494, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cov, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4503, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4494, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4503, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cov, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4494, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cov, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4503, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4494, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4503, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4494, __pyx_L1_error)
+  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4503, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 4494, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 4503, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_t_6 = __pyx_t_5;
   __pyx_L9_bool_binop_done:;
   if (unlikely(__pyx_t_6)) {
 
-    /* "mtrand.pyx":4495
+    /* "mtrand.pyx":4504
  *             raise ValueError("mean must be 1 dimensional")
  *         if (len(cov.shape) != 2) or (cov.shape[0] != cov.shape[1]):
  *             raise ValueError("cov must be 2 dimensional and square")             # <<<<<<<<<<<<<<
  *         if mean.shape[0] != cov.shape[0]:
  *             raise ValueError("mean and cov must have same length")
  */
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4495, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4504, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __PYX_ERR(0, 4495, __pyx_L1_error)
+    __PYX_ERR(0, 4504, __pyx_L1_error)
 
-    /* "mtrand.pyx":4494
+    /* "mtrand.pyx":4503
  *         if len(mean.shape) != 1:
  *             raise ValueError("mean must be 1 dimensional")
  *         if (len(cov.shape) != 2) or (cov.shape[0] != cov.shape[1]):             # <<<<<<<<<<<<<<
@@ -34371,44 +34434,44 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_96multivariate_normal(struct __p
  */
   }
 
-  /* "mtrand.pyx":4496
+  /* "mtrand.pyx":4505
  *         if (len(cov.shape) != 2) or (cov.shape[0] != cov.shape[1]):
  *             raise ValueError("cov must be 2 dimensional and square")
  *         if mean.shape[0] != cov.shape[0]:             # <<<<<<<<<<<<<<
  *             raise ValueError("mean and cov must have same length")
  * 
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mean, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4496, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mean, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4505, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4496, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4505, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cov, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4496, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cov, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4505, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4496, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4505, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4496, __pyx_L1_error)
+  __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4505, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 4496, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 4505, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (unlikely(__pyx_t_6)) {
 
-    /* "mtrand.pyx":4497
+    /* "mtrand.pyx":4506
  *             raise ValueError("cov must be 2 dimensional and square")
  *         if mean.shape[0] != cov.shape[0]:
  *             raise ValueError("mean and cov must have same length")             # <<<<<<<<<<<<<<
  * 
  *         # Compute shape of output and create a matrix of independent
  */
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4497, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4506, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __PYX_ERR(0, 4497, __pyx_L1_error)
+    __PYX_ERR(0, 4506, __pyx_L1_error)
 
-    /* "mtrand.pyx":4496
+    /* "mtrand.pyx":4505
  *         if (len(cov.shape) != 2) or (cov.shape[0] != cov.shape[1]):
  *             raise ValueError("cov must be 2 dimensional and square")
  *         if mean.shape[0] != cov.shape[0]:             # <<<<<<<<<<<<<<
@@ -34417,44 +34480,44 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_96multivariate_normal(struct __p
  */
   }
 
-  /* "mtrand.pyx":4503
+  /* "mtrand.pyx":4512
  *         # with the same length as mean and as many rows are necessary to
  *         # form a matrix of shape final_shape.
  *         final_shape = list(shape[:])             # <<<<<<<<<<<<<<
  *         final_shape.append(mean.shape[0])
  *         x = self.standard_normal(final_shape).reshape(-1, mean.shape[0])
  */
-  __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_shape, 0, 0, NULL, NULL, &__pyx_slice__67, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4503, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_shape, 0, 0, NULL, NULL, &__pyx_slice__68, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4512, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4503, __pyx_L1_error)
+  __pyx_t_2 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4512, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_v_final_shape = ((PyObject*)__pyx_t_2);
   __pyx_t_2 = 0;
 
-  /* "mtrand.pyx":4504
+  /* "mtrand.pyx":4513
  *         # form a matrix of shape final_shape.
  *         final_shape = list(shape[:])
  *         final_shape.append(mean.shape[0])             # <<<<<<<<<<<<<<
  *         x = self.standard_normal(final_shape).reshape(-1, mean.shape[0])
  * 
  */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_mean, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4504, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_mean, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4513, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4504, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4513, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_final_shape, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 4504, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_final_shape, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 4513, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "mtrand.pyx":4505
+  /* "mtrand.pyx":4514
  *         final_shape = list(shape[:])
  *         final_shape.append(mean.shape[0])
  *         x = self.standard_normal(final_shape).reshape(-1, mean.shape[0])             # <<<<<<<<<<<<<<
  * 
  *         # Transform matrix of standard normals into matrix where each row
  */
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_standard_normal); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4505, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_standard_normal); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4514, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_t_9 = NULL;
   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
@@ -34468,15 +34531,15 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_96multivariate_normal(struct __p
   }
   __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_9, __pyx_v_final_shape) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_final_shape);
   __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
-  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4505, __pyx_L1_error)
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4514, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_reshape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4505, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_reshape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4514, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_mean, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4505, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_mean, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4514, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4505, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4514, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_t_2 = NULL;
@@ -34494,7 +34557,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_96multivariate_normal(struct __p
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_3)) {
     PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_int_neg_1, __pyx_t_9};
-    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4505, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4514, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
@@ -34503,14 +34566,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_96multivariate_normal(struct __p
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
     PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_int_neg_1, __pyx_t_9};
-    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4505, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4514, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
   } else
   #endif
   {
-    __pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4505, __pyx_L1_error)
+    __pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4514, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_11);
     if (__pyx_t_2) {
       __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2); __pyx_t_2 = NULL;
@@ -34521,7 +34584,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_96multivariate_normal(struct __p
     __Pyx_GIVEREF(__pyx_t_9);
     PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_9);
     __pyx_t_9 = 0;
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4505, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4514, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
   }
@@ -34529,7 +34592,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_96multivariate_normal(struct __p
   __pyx_v_x = __pyx_t_1;
   __pyx_t_1 = 0;
 
-  /* "mtrand.pyx":4520
+  /* "mtrand.pyx":4529
  *         # order to preserve current outputs.
  * 
  *         (u, s, v) = svd(cov)             # <<<<<<<<<<<<<<
@@ -34549,7 +34612,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_96multivariate_normal(struct __p
   }
   __pyx_t_1 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_11, __pyx_v_cov) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_cov);
   __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
-  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4520, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4529, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
@@ -34558,7 +34621,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_96multivariate_normal(struct __p
     if (unlikely(size != 3)) {
       if (size > 3) __Pyx_RaiseTooManyValuesError(3);
       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-      __PYX_ERR(0, 4520, __pyx_L1_error)
+      __PYX_ERR(0, 4529, __pyx_L1_error)
     }
     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
     if (likely(PyTuple_CheckExact(sequence))) {
@@ -34574,17 +34637,17 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_96multivariate_normal(struct __p
     __Pyx_INCREF(__pyx_t_11);
     __Pyx_INCREF(__pyx_t_9);
     #else
-    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4520, __pyx_L1_error)
+    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4529, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4520, __pyx_L1_error)
+    __pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4529, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_11);
-    __pyx_t_9 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4520, __pyx_L1_error)
+    __pyx_t_9 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4529, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_9);
     #endif
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   } else {
     Py_ssize_t index = -1;
-    __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4520, __pyx_L1_error)
+    __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4529, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __pyx_t_12 = Py_TYPE(__pyx_t_2)->tp_iternext;
@@ -34594,7 +34657,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_96multivariate_normal(struct __p
     __Pyx_GOTREF(__pyx_t_11);
     index = 2; __pyx_t_9 = __pyx_t_12(__pyx_t_2); if (unlikely(!__pyx_t_9)) goto __pyx_L12_unpacking_failed;
     __Pyx_GOTREF(__pyx_t_9);
-    if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_2), 3) < 0) __PYX_ERR(0, 4520, __pyx_L1_error)
+    if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_2), 3) < 0) __PYX_ERR(0, 4529, __pyx_L1_error)
     __pyx_t_12 = NULL;
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     goto __pyx_L13_unpacking_done;
@@ -34602,7 +34665,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_96multivariate_normal(struct __p
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __pyx_t_12 = NULL;
     if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-    __PYX_ERR(0, 4520, __pyx_L1_error)
+    __PYX_ERR(0, 4529, __pyx_L1_error)
     __pyx_L13_unpacking_done:;
   }
   __pyx_v_u = __pyx_t_3;
@@ -34612,48 +34675,48 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_96multivariate_normal(struct __p
   __pyx_v_v = __pyx_t_9;
   __pyx_t_9 = 0;
 
-  /* "mtrand.pyx":4522
+  /* "mtrand.pyx":4531
  *         (u, s, v) = svd(cov)
  * 
  *         if check_valid != 'ignore':             # <<<<<<<<<<<<<<
  *             if check_valid != 'warn' and check_valid != 'raise':
  *                 raise ValueError("check_valid must equal 'warn', 'raise', or 'ignore'")
  */
-  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_check_valid, __pyx_n_s_ignore, Py_NE)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 4522, __pyx_L1_error)
+  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_check_valid, __pyx_n_s_ignore, Py_NE)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 4531, __pyx_L1_error)
   if (__pyx_t_6) {
 
-    /* "mtrand.pyx":4523
+    /* "mtrand.pyx":4532
  * 
  *         if check_valid != 'ignore':
  *             if check_valid != 'warn' and check_valid != 'raise':             # <<<<<<<<<<<<<<
  *                 raise ValueError("check_valid must equal 'warn', 'raise', or 'ignore'")
  * 
  */
-    __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_check_valid, __pyx_n_s_warn, Py_NE)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 4523, __pyx_L1_error)
+    __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_check_valid, __pyx_n_s_warn, Py_NE)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 4532, __pyx_L1_error)
     if (__pyx_t_5) {
     } else {
       __pyx_t_6 = __pyx_t_5;
       goto __pyx_L16_bool_binop_done;
     }
-    __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_check_valid, __pyx_n_s_raise, Py_NE)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 4523, __pyx_L1_error)
+    __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_check_valid, __pyx_n_s_raise, Py_NE)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 4532, __pyx_L1_error)
     __pyx_t_6 = __pyx_t_5;
     __pyx_L16_bool_binop_done:;
     if (unlikely(__pyx_t_6)) {
 
-      /* "mtrand.pyx":4524
+      /* "mtrand.pyx":4533
  *         if check_valid != 'ignore':
  *             if check_valid != 'warn' and check_valid != 'raise':
  *                 raise ValueError("check_valid must equal 'warn', 'raise', or 'ignore'")             # <<<<<<<<<<<<<<
  * 
  *             psd = np.allclose(np.dot(v.T * s, v), cov, rtol=tol, atol=tol)
  */
-      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__68, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4524, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__69, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4533, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_Raise(__pyx_t_1, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __PYX_ERR(0, 4524, __pyx_L1_error)
+      __PYX_ERR(0, 4533, __pyx_L1_error)
 
-      /* "mtrand.pyx":4523
+      /* "mtrand.pyx":4532
  * 
  *         if check_valid != 'ignore':
  *             if check_valid != 'warn' and check_valid != 'raise':             # <<<<<<<<<<<<<<
@@ -34662,26 +34725,26 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_96multivariate_normal(struct __p
  */
     }
 
-    /* "mtrand.pyx":4526
+    /* "mtrand.pyx":4535
  *                 raise ValueError("check_valid must equal 'warn', 'raise', or 'ignore'")
  * 
  *             psd = np.allclose(np.dot(v.T * s, v), cov, rtol=tol, atol=tol)             # <<<<<<<<<<<<<<
  *             if not psd:
  *                 if check_valid == 'warn':
  */
-    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4526, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4535, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_allclose); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4526, __pyx_L1_error)
+    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_allclose); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4535, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_9);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4526, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4535, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_11);
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_dot); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4526, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_dot); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4535, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_T); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4526, __pyx_L1_error)
+    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_T); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4535, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_11);
-    __pyx_t_2 = PyNumber_Multiply(__pyx_t_11, __pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4526, __pyx_L1_error)
+    __pyx_t_2 = PyNumber_Multiply(__pyx_t_11, __pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4535, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
     __pyx_t_11 = NULL;
@@ -34699,7 +34762,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_96multivariate_normal(struct __p
     #if CYTHON_FAST_PYCALL
     if (PyFunction_Check(__pyx_t_3)) {
       PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_2, __pyx_v_v};
-      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4526, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4535, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -34708,14 +34771,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_96multivariate_normal(struct __p
     #if CYTHON_FAST_PYCCALL
     if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
       PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_2, __pyx_v_v};
-      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4526, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4535, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     } else
     #endif
     {
-      __pyx_t_13 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4526, __pyx_L1_error)
+      __pyx_t_13 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4535, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_13);
       if (__pyx_t_11) {
         __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
@@ -34726,12 +34789,12 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_96multivariate_normal(struct __p
       __Pyx_GIVEREF(__pyx_v_v);
       PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_10, __pyx_v_v);
       __pyx_t_2 = 0;
-      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_13, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4526, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_13, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4535, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
     }
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4526, __pyx_L1_error)
+    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4535, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_GIVEREF(__pyx_t_1);
     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
@@ -34739,11 +34802,11 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_96multivariate_normal(struct __p
     __Pyx_GIVEREF(__pyx_v_cov);
     PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_cov);
     __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4526, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4535, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
-    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_rtol, __pyx_v_tol) < 0) __PYX_ERR(0, 4526, __pyx_L1_error)
-    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_atol, __pyx_v_tol) < 0) __PYX_ERR(0, 4526, __pyx_L1_error)
-    __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4526, __pyx_L1_error)
+    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_rtol, __pyx_v_tol) < 0) __PYX_ERR(0, 4535, __pyx_L1_error)
+    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_atol, __pyx_v_tol) < 0) __PYX_ERR(0, 4535, __pyx_L1_error)
+    __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4535, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_13);
     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -34751,53 +34814,53 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_96multivariate_normal(struct __p
     __pyx_v_psd = __pyx_t_13;
     __pyx_t_13 = 0;
 
-    /* "mtrand.pyx":4527
+    /* "mtrand.pyx":4536
  * 
  *             psd = np.allclose(np.dot(v.T * s, v), cov, rtol=tol, atol=tol)
  *             if not psd:             # <<<<<<<<<<<<<<
  *                 if check_valid == 'warn':
  *                     warnings.warn(
  */
-    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_psd); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 4527, __pyx_L1_error)
+    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_psd); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 4536, __pyx_L1_error)
     __pyx_t_5 = ((!__pyx_t_6) != 0);
     if (__pyx_t_5) {
 
-      /* "mtrand.pyx":4528
+      /* "mtrand.pyx":4537
  *             psd = np.allclose(np.dot(v.T * s, v), cov, rtol=tol, atol=tol)
  *             if not psd:
  *                 if check_valid == 'warn':             # <<<<<<<<<<<<<<
  *                     warnings.warn(
  *                         "covariance is not symmetric positive-semidefinite.",
  */
-      __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_check_valid, __pyx_n_s_warn, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 4528, __pyx_L1_error)
+      __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_check_valid, __pyx_n_s_warn, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 4537, __pyx_L1_error)
       if (likely(__pyx_t_5)) {
 
-        /* "mtrand.pyx":4529
+        /* "mtrand.pyx":4538
  *             if not psd:
  *                 if check_valid == 'warn':
  *                     warnings.warn(             # <<<<<<<<<<<<<<
  *                         "covariance is not symmetric positive-semidefinite.",
  *                         RuntimeWarning)
  */
-        __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_warnings); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4529, __pyx_L1_error)
+        __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_warnings); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4538, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_13);
-        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_warn); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4529, __pyx_L1_error)
+        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_warn); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4538, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_1);
         __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
 
-        /* "mtrand.pyx":4531
+        /* "mtrand.pyx":4540
  *                     warnings.warn(
  *                         "covariance is not symmetric positive-semidefinite.",
  *                         RuntimeWarning)             # <<<<<<<<<<<<<<
  *                 else:
  *                     raise ValueError(
  */
-        __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__69, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4529, __pyx_L1_error)
+        __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__70, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4538, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_13);
         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
         __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
 
-        /* "mtrand.pyx":4528
+        /* "mtrand.pyx":4537
  *             psd = np.allclose(np.dot(v.T * s, v), cov, rtol=tol, atol=tol)
  *             if not psd:
  *                 if check_valid == 'warn':             # <<<<<<<<<<<<<<
@@ -34807,7 +34870,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_96multivariate_normal(struct __p
         goto __pyx_L19;
       }
 
-      /* "mtrand.pyx":4533
+      /* "mtrand.pyx":4542
  *                         RuntimeWarning)
  *                 else:
  *                     raise ValueError(             # <<<<<<<<<<<<<<
@@ -34815,15 +34878,15 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_96multivariate_normal(struct __p
  * 
  */
       /*else*/ {
-        __pyx_t_13 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__70, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4533, __pyx_L1_error)
+        __pyx_t_13 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__71, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4542, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_13);
         __Pyx_Raise(__pyx_t_13, 0, 0, 0);
         __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-        __PYX_ERR(0, 4533, __pyx_L1_error)
+        __PYX_ERR(0, 4542, __pyx_L1_error)
       }
       __pyx_L19:;
 
-      /* "mtrand.pyx":4527
+      /* "mtrand.pyx":4536
  * 
  *             psd = np.allclose(np.dot(v.T * s, v), cov, rtol=tol, atol=tol)
  *             if not psd:             # <<<<<<<<<<<<<<
@@ -34832,7 +34895,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_96multivariate_normal(struct __p
  */
     }
 
-    /* "mtrand.pyx":4522
+    /* "mtrand.pyx":4531
  *         (u, s, v) = svd(cov)
  * 
  *         if check_valid != 'ignore':             # <<<<<<<<<<<<<<
@@ -34841,21 +34904,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_96multivariate_normal(struct __p
  */
   }
 
-  /* "mtrand.pyx":4536
+  /* "mtrand.pyx":4545
  *                         "covariance is not symmetric positive-semidefinite.")
  * 
  *         x = np.dot(x, np.sqrt(s)[:, None] * v)             # <<<<<<<<<<<<<<
  *         x += mean
  *         x.shape = tuple(final_shape)
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4536, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4545, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dot); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4536, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dot); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4545, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4536, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4545, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4536, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4545, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
   __pyx_t_9 = NULL;
@@ -34870,13 +34933,13 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_96multivariate_normal(struct __p
   }
   __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_9, __pyx_v_s) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_s);
   __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
-  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4536, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4545, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_tuple__71); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4536, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_tuple__72); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4545, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_v_v); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4536, __pyx_L1_error)
+  __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_v_v); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4545, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_t_2 = NULL;
@@ -34894,7 +34957,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_96multivariate_normal(struct __p
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_3)) {
     PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_x, __pyx_t_1};
-    __pyx_t_13 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4536, __pyx_L1_error)
+    __pyx_t_13 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4545, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_GOTREF(__pyx_t_13);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -34903,14 +34966,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_96multivariate_normal(struct __p
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
     PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_x, __pyx_t_1};
-    __pyx_t_13 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4536, __pyx_L1_error)
+    __pyx_t_13 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4545, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_GOTREF(__pyx_t_13);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   } else
   #endif
   {
-    __pyx_t_9 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4536, __pyx_L1_error)
+    __pyx_t_9 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4545, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_9);
     if (__pyx_t_2) {
       __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2); __pyx_t_2 = NULL;
@@ -34921,7 +34984,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_96multivariate_normal(struct __p
     __Pyx_GIVEREF(__pyx_t_1);
     PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_10, __pyx_t_1);
     __pyx_t_1 = 0;
-    __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4536, __pyx_L1_error)
+    __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4545, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_13);
     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
   }
@@ -34929,31 +34992,31 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_96multivariate_normal(struct __p
   __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_13);
   __pyx_t_13 = 0;
 
-  /* "mtrand.pyx":4537
+  /* "mtrand.pyx":4546
  * 
  *         x = np.dot(x, np.sqrt(s)[:, None] * v)
  *         x += mean             # <<<<<<<<<<<<<<
  *         x.shape = tuple(final_shape)
  *         return x
  */
-  __pyx_t_13 = PyNumber_InPlaceAdd(__pyx_v_x, __pyx_v_mean); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4537, __pyx_L1_error)
+  __pyx_t_13 = PyNumber_InPlaceAdd(__pyx_v_x, __pyx_v_mean); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4546, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_13);
   __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_13);
   __pyx_t_13 = 0;
 
-  /* "mtrand.pyx":4538
+  /* "mtrand.pyx":4547
  *         x = np.dot(x, np.sqrt(s)[:, None] * v)
  *         x += mean
  *         x.shape = tuple(final_shape)             # <<<<<<<<<<<<<<
  *         return x
  * 
  */
-  __pyx_t_13 = PyList_AsTuple(__pyx_v_final_shape); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4538, __pyx_L1_error)
+  __pyx_t_13 = PyList_AsTuple(__pyx_v_final_shape); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4547, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_13);
-  if (__Pyx_PyObject_SetAttrStr(__pyx_v_x, __pyx_n_s_shape, __pyx_t_13) < 0) __PYX_ERR(0, 4538, __pyx_L1_error)
+  if (__Pyx_PyObject_SetAttrStr(__pyx_v_x, __pyx_n_s_shape, __pyx_t_13) < 0) __PYX_ERR(0, 4547, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
 
-  /* "mtrand.pyx":4539
+  /* "mtrand.pyx":4548
  *         x += mean
  *         x.shape = tuple(final_shape)
  *         return x             # <<<<<<<<<<<<<<
@@ -34965,7 +35028,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_96multivariate_normal(struct __p
   __pyx_r = __pyx_v_x;
   goto __pyx_L0;
 
-  /* "mtrand.pyx":4379
+  /* "mtrand.pyx":4388
  * 
  *     # Multivariate distributions:
  *     def multivariate_normal(self, mean, cov, size=None, check_valid='warn',             # <<<<<<<<<<<<<<
@@ -34999,7 +35062,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_96multivariate_normal(struct __p
   return __pyx_r;
 }
 
-/* "mtrand.pyx":4541
+/* "mtrand.pyx":4550
  *         return x
  * 
  *     def multinomial(self, npy_intp n, object pvals, size=None):             # <<<<<<<<<<<<<<
@@ -35043,7 +35106,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_99multinomial(PyObject *__pyx_v_
         case  1:
         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pvals)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("multinomial", 0, 2, 3, 1); __PYX_ERR(0, 4541, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("multinomial", 0, 2, 3, 1); __PYX_ERR(0, 4550, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  2:
@@ -35053,7 +35116,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_99multinomial(PyObject *__pyx_v_
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "multinomial") < 0)) __PYX_ERR(0, 4541, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "multinomial") < 0)) __PYX_ERR(0, 4550, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -35065,13 +35128,13 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_99multinomial(PyObject *__pyx_v_
         default: goto __pyx_L5_argtuple_error;
       }
     }
-    __pyx_v_n = __Pyx_PyInt_As_npy_intp(values[0]); if (unlikely((__pyx_v_n == ((npy_intp)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4541, __pyx_L3_error)
+    __pyx_v_n = __Pyx_PyInt_As_npy_intp(values[0]); if (unlikely((__pyx_v_n == ((npy_intp)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4550, __pyx_L3_error)
     __pyx_v_pvals = values[1];
     __pyx_v_size = values[2];
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("multinomial", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4541, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("multinomial", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4550, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("mtrand.RandomState.multinomial", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -35114,24 +35177,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_98multinomial(struct __pyx_obj_6
   long __pyx_t_13;
   __Pyx_RefNannySetupContext("multinomial", 0);
 
-  /* "mtrand.pyx":4623
+  /* "mtrand.pyx":4632
  *         cdef double Sum
  * 
  *         d = len(pvals)             # <<<<<<<<<<<<<<
  *         parr = <ndarray>PyArray_ContiguousFromObject(pvals, NPY_DOUBLE, 1, 1)
  *         pix = <double*>PyArray_DATA(parr)
  */
-  __pyx_t_1 = PyObject_Length(__pyx_v_pvals); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 4623, __pyx_L1_error)
+  __pyx_t_1 = PyObject_Length(__pyx_v_pvals); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 4632, __pyx_L1_error)
   __pyx_v_d = __pyx_t_1;
 
-  /* "mtrand.pyx":4624
+  /* "mtrand.pyx":4633
  * 
  *         d = len(pvals)
  *         parr = <ndarray>PyArray_ContiguousFromObject(pvals, NPY_DOUBLE, 1, 1)             # <<<<<<<<<<<<<<
  *         pix = <double*>PyArray_DATA(parr)
  * 
  */
-  __pyx_t_2 = PyArray_ContiguousFromObject(__pyx_v_pvals, NPY_DOUBLE, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4624, __pyx_L1_error)
+  __pyx_t_2 = PyArray_ContiguousFromObject(__pyx_v_pvals, NPY_DOUBLE, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4633, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_3 = __pyx_t_2;
   __Pyx_INCREF(__pyx_t_3);
@@ -35139,7 +35202,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_98multinomial(struct __pyx_obj_6
   arrayObject_parr = ((PyArrayObject *)__pyx_t_3);
   __pyx_t_3 = 0;
 
-  /* "mtrand.pyx":4625
+  /* "mtrand.pyx":4634
  *         d = len(pvals)
  *         parr = <ndarray>PyArray_ContiguousFromObject(pvals, NPY_DOUBLE, 1, 1)
  *         pix = <double*>PyArray_DATA(parr)             # <<<<<<<<<<<<<<
@@ -35148,7 +35211,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_98multinomial(struct __pyx_obj_6
  */
   __pyx_v_pix = ((double *)PyArray_DATA(arrayObject_parr));
 
-  /* "mtrand.pyx":4627
+  /* "mtrand.pyx":4636
  *         pix = <double*>PyArray_DATA(parr)
  * 
  *         if kahan_sum(pix, d-1) > (1.0 + 1e-12):             # <<<<<<<<<<<<<<
@@ -35158,20 +35221,20 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_98multinomial(struct __pyx_obj_6
   __pyx_t_4 = ((__pyx_f_6mtrand_kahan_sum(__pyx_v_pix, (__pyx_v_d - 1)) > (1.0 + 1e-12)) != 0);
   if (unlikely(__pyx_t_4)) {
 
-    /* "mtrand.pyx":4628
+    /* "mtrand.pyx":4637
  * 
  *         if kahan_sum(pix, d-1) > (1.0 + 1e-12):
  *             raise ValueError("sum(pvals[:-1]) > 1.0")             # <<<<<<<<<<<<<<
  * 
  *         shape = _shape_from_size(size, d)
  */
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__72, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4628, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__73, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4637, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __PYX_ERR(0, 4628, __pyx_L1_error)
+    __PYX_ERR(0, 4637, __pyx_L1_error)
 
-    /* "mtrand.pyx":4627
+    /* "mtrand.pyx":4636
  *         pix = <double*>PyArray_DATA(parr)
  * 
  *         if kahan_sum(pix, d-1) > (1.0 + 1e-12):             # <<<<<<<<<<<<<<
@@ -35180,16 +35243,16 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_98multinomial(struct __pyx_obj_6
  */
   }
 
-  /* "mtrand.pyx":4630
+  /* "mtrand.pyx":4639
  *             raise ValueError("sum(pvals[:-1]) > 1.0")
  * 
  *         shape = _shape_from_size(size, d)             # <<<<<<<<<<<<<<
  * 
  *         multin = np.zeros(shape, int)
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_shape_from_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4630, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_shape_from_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4639, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_5 = __Pyx_PyInt_From_npy_intp(__pyx_v_d); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4630, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyInt_From_npy_intp(__pyx_v_d); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4639, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __pyx_t_6 = NULL;
   __pyx_t_7 = 0;
@@ -35206,7 +35269,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_98multinomial(struct __pyx_obj_6
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_2)) {
     PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_size, __pyx_t_5};
-    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4630, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4639, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
@@ -35215,14 +35278,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_98multinomial(struct __pyx_obj_6
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
     PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_size, __pyx_t_5};
-    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4630, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4639, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   } else
   #endif
   {
-    __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4630, __pyx_L1_error)
+    __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4639, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_8);
     if (__pyx_t_6) {
       __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
@@ -35233,7 +35296,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_98multinomial(struct __pyx_obj_6
     __Pyx_GIVEREF(__pyx_t_5);
     PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_5);
     __pyx_t_5 = 0;
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4630, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4639, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   }
@@ -35241,16 +35304,16 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_98multinomial(struct __pyx_obj_6
   __pyx_v_shape = __pyx_t_3;
   __pyx_t_3 = 0;
 
-  /* "mtrand.pyx":4632
+  /* "mtrand.pyx":4641
  *         shape = _shape_from_size(size, d)
  * 
  *         multin = np.zeros(shape, int)             # <<<<<<<<<<<<<<
  *         mnarr = <ndarray>multin
  *         mnix = <long*>PyArray_DATA(mnarr)
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4632, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4641, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4632, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4641, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_t_2 = NULL;
@@ -35268,7 +35331,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_98multinomial(struct __pyx_obj_6
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_8)) {
     PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_shape, ((PyObject *)(&PyInt_Type))};
-    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4632, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4641, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_GOTREF(__pyx_t_3);
   } else
@@ -35276,13 +35339,13 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_98multinomial(struct __pyx_obj_6
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
     PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_shape, ((PyObject *)(&PyInt_Type))};
-    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4632, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4641, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_GOTREF(__pyx_t_3);
   } else
   #endif
   {
-    __pyx_t_5 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4632, __pyx_L1_error)
+    __pyx_t_5 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4641, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     if (__pyx_t_2) {
       __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
@@ -35293,7 +35356,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_98multinomial(struct __pyx_obj_6
     __Pyx_INCREF(((PyObject *)(&PyInt_Type)));
     __Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
     PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_7, ((PyObject *)(&PyInt_Type)));
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4632, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4641, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   }
@@ -35301,7 +35364,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_98multinomial(struct __pyx_obj_6
   __pyx_v_multin = __pyx_t_3;
   __pyx_t_3 = 0;
 
-  /* "mtrand.pyx":4633
+  /* "mtrand.pyx":4642
  * 
  *         multin = np.zeros(shape, int)
  *         mnarr = <ndarray>multin             # <<<<<<<<<<<<<<
@@ -35313,7 +35376,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_98multinomial(struct __pyx_obj_6
   arrayObject_mnarr = ((PyArrayObject *)__pyx_t_3);
   __pyx_t_3 = 0;
 
-  /* "mtrand.pyx":4634
+  /* "mtrand.pyx":4643
  *         multin = np.zeros(shape, int)
  *         mnarr = <ndarray>multin
  *         mnix = <long*>PyArray_DATA(mnarr)             # <<<<<<<<<<<<<<
@@ -35322,7 +35385,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_98multinomial(struct __pyx_obj_6
  */
   __pyx_v_mnix = ((long *)PyArray_DATA(arrayObject_mnarr));
 
-  /* "mtrand.pyx":4635
+  /* "mtrand.pyx":4644
  *         mnarr = <ndarray>multin
  *         mnix = <long*>PyArray_DATA(mnarr)
  *         sz = PyArray_SIZE(mnarr)             # <<<<<<<<<<<<<<
@@ -35331,7 +35394,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_98multinomial(struct __pyx_obj_6
  */
   __pyx_v_sz = PyArray_SIZE(arrayObject_mnarr);
 
-  /* "mtrand.pyx":4636
+  /* "mtrand.pyx":4645
  *         mnix = <long*>PyArray_DATA(mnarr)
  *         sz = PyArray_SIZE(mnarr)
  *         with self.lock, nogil, cython.cdivision(True):             # <<<<<<<<<<<<<<
@@ -35339,9 +35402,9 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_98multinomial(struct __pyx_obj_6
  *             while i < sz:
  */
   /*with:*/ {
-    __pyx_t_9 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->lock, __pyx_n_s_exit); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4636, __pyx_L1_error)
+    __pyx_t_9 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->lock, __pyx_n_s_exit); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4645, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_9);
-    __pyx_t_8 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->lock, __pyx_n_s_enter); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4636, __pyx_L4_error)
+    __pyx_t_8 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->lock, __pyx_n_s_enter); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4645, __pyx_L4_error)
     __Pyx_GOTREF(__pyx_t_8);
     __pyx_t_5 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
@@ -35355,7 +35418,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_98multinomial(struct __pyx_obj_6
     }
     __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
-    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4636, __pyx_L4_error)
+    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4645, __pyx_L4_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -35371,7 +35434,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_98multinomial(struct __pyx_obj_6
               #endif
               /*try:*/ {
 
-                /* "mtrand.pyx":4637
+                /* "mtrand.pyx":4646
  *         sz = PyArray_SIZE(mnarr)
  *         with self.lock, nogil, cython.cdivision(True):
  *             i = 0             # <<<<<<<<<<<<<<
@@ -35380,7 +35443,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_98multinomial(struct __pyx_obj_6
  */
                 __pyx_v_i = 0;
 
-                /* "mtrand.pyx":4638
+                /* "mtrand.pyx":4647
  *         with self.lock, nogil, cython.cdivision(True):
  *             i = 0
  *             while i < sz:             # <<<<<<<<<<<<<<
@@ -35391,7 +35454,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_98multinomial(struct __pyx_obj_6
                   __pyx_t_4 = ((__pyx_v_i < __pyx_v_sz) != 0);
                   if (!__pyx_t_4) break;
 
-                  /* "mtrand.pyx":4639
+                  /* "mtrand.pyx":4648
  *             i = 0
  *             while i < sz:
  *                 Sum = 1.0             # <<<<<<<<<<<<<<
@@ -35400,7 +35463,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_98multinomial(struct __pyx_obj_6
  */
                   __pyx_v_Sum = 1.0;
 
-                  /* "mtrand.pyx":4640
+                  /* "mtrand.pyx":4649
  *             while i < sz:
  *                 Sum = 1.0
  *                 dn = n             # <<<<<<<<<<<<<<
@@ -35409,7 +35472,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_98multinomial(struct __pyx_obj_6
  */
                   __pyx_v_dn = __pyx_v_n;
 
-                  /* "mtrand.pyx":4641
+                  /* "mtrand.pyx":4650
  *                 Sum = 1.0
  *                 dn = n
  *                 for j from 0 <= j < d-1:             # <<<<<<<<<<<<<<
@@ -35419,7 +35482,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_98multinomial(struct __pyx_obj_6
                   __pyx_t_13 = (__pyx_v_d - 1);
                   for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_13; __pyx_v_j++) {
 
-                    /* "mtrand.pyx":4642
+                    /* "mtrand.pyx":4651
  *                 dn = n
  *                 for j from 0 <= j < d-1:
  *                     mnix[i+j] = rk_binomial(self.internal_state, dn, pix[j]/Sum)             # <<<<<<<<<<<<<<
@@ -35428,7 +35491,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_98multinomial(struct __pyx_obj_6
  */
                     (__pyx_v_mnix[(__pyx_v_i + __pyx_v_j)]) = rk_binomial(__pyx_v_self->internal_state, __pyx_v_dn, ((__pyx_v_pix[__pyx_v_j]) / __pyx_v_Sum));
 
-                    /* "mtrand.pyx":4643
+                    /* "mtrand.pyx":4652
  *                 for j from 0 <= j < d-1:
  *                     mnix[i+j] = rk_binomial(self.internal_state, dn, pix[j]/Sum)
  *                     dn = dn - mnix[i+j]             # <<<<<<<<<<<<<<
@@ -35437,7 +35500,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_98multinomial(struct __pyx_obj_6
  */
                     __pyx_v_dn = (__pyx_v_dn - (__pyx_v_mnix[(__pyx_v_i + __pyx_v_j)]));
 
-                    /* "mtrand.pyx":4644
+                    /* "mtrand.pyx":4653
  *                     mnix[i+j] = rk_binomial(self.internal_state, dn, pix[j]/Sum)
  *                     dn = dn - mnix[i+j]
  *                     if dn <= 0:             # <<<<<<<<<<<<<<
@@ -35447,7 +35510,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_98multinomial(struct __pyx_obj_6
                     __pyx_t_4 = ((__pyx_v_dn <= 0) != 0);
                     if (__pyx_t_4) {
 
-                      /* "mtrand.pyx":4645
+                      /* "mtrand.pyx":4654
  *                     dn = dn - mnix[i+j]
  *                     if dn <= 0:
  *                         break             # <<<<<<<<<<<<<<
@@ -35456,7 +35519,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_98multinomial(struct __pyx_obj_6
  */
                       goto __pyx_L20_break;
 
-                      /* "mtrand.pyx":4644
+                      /* "mtrand.pyx":4653
  *                     mnix[i+j] = rk_binomial(self.internal_state, dn, pix[j]/Sum)
  *                     dn = dn - mnix[i+j]
  *                     if dn <= 0:             # <<<<<<<<<<<<<<
@@ -35465,7 +35528,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_98multinomial(struct __pyx_obj_6
  */
                     }
 
-                    /* "mtrand.pyx":4646
+                    /* "mtrand.pyx":4655
  *                     if dn <= 0:
  *                         break
  *                     Sum = Sum - pix[j]             # <<<<<<<<<<<<<<
@@ -35476,7 +35539,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_98multinomial(struct __pyx_obj_6
                   }
                   __pyx_L20_break:;
 
-                  /* "mtrand.pyx":4647
+                  /* "mtrand.pyx":4656
  *                         break
  *                     Sum = Sum - pix[j]
  *                 if dn > 0:             # <<<<<<<<<<<<<<
@@ -35486,7 +35549,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_98multinomial(struct __pyx_obj_6
                   __pyx_t_4 = ((__pyx_v_dn > 0) != 0);
                   if (__pyx_t_4) {
 
-                    /* "mtrand.pyx":4648
+                    /* "mtrand.pyx":4657
  *                     Sum = Sum - pix[j]
  *                 if dn > 0:
  *                     mnix[i+d-1] = dn             # <<<<<<<<<<<<<<
@@ -35495,7 +35558,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_98multinomial(struct __pyx_obj_6
  */
                     (__pyx_v_mnix[((__pyx_v_i + __pyx_v_d) - 1)]) = __pyx_v_dn;
 
-                    /* "mtrand.pyx":4647
+                    /* "mtrand.pyx":4656
  *                         break
  *                     Sum = Sum - pix[j]
  *                 if dn > 0:             # <<<<<<<<<<<<<<
@@ -35504,7 +35567,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_98multinomial(struct __pyx_obj_6
  */
                   }
 
-                  /* "mtrand.pyx":4650
+                  /* "mtrand.pyx":4659
  *                     mnix[i+d-1] = dn
  * 
  *                 i = i + d             # <<<<<<<<<<<<<<
@@ -35515,7 +35578,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_98multinomial(struct __pyx_obj_6
                 }
               }
 
-              /* "mtrand.pyx":4636
+              /* "mtrand.pyx":4645
  *         mnix = <long*>PyArray_DATA(mnarr)
  *         sz = PyArray_SIZE(mnarr)
  *         with self.lock, nogil, cython.cdivision(True):             # <<<<<<<<<<<<<<
@@ -35541,7 +35604,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_98multinomial(struct __pyx_obj_6
         if (__pyx_t_9) {
           __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__2, NULL);
           __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-          if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4636, __pyx_L1_error)
+          if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4645, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_12);
           __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
         }
@@ -35556,7 +35619,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_98multinomial(struct __pyx_obj_6
     __pyx_L23:;
   }
 
-  /* "mtrand.pyx":4652
+  /* "mtrand.pyx":4661
  *                 i = i + d
  * 
  *         return multin             # <<<<<<<<<<<<<<
@@ -35568,7 +35631,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_98multinomial(struct __pyx_obj_6
   __pyx_r = __pyx_v_multin;
   goto __pyx_L0;
 
-  /* "mtrand.pyx":4541
+  /* "mtrand.pyx":4550
  *         return x
  * 
  *     def multinomial(self, npy_intp n, object pvals, size=None):             # <<<<<<<<<<<<<<
@@ -35595,7 +35658,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_98multinomial(struct __pyx_obj_6
   return __pyx_r;
 }
 
-/* "mtrand.pyx":4654
+/* "mtrand.pyx":4663
  *         return multin
  * 
  *     def dirichlet(self, object alpha, size=None):             # <<<<<<<<<<<<<<
@@ -35605,7 +35668,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_98multinomial(struct __pyx_obj_6
 
 /* Python wrapper */
 static PyObject *__pyx_pw_6mtrand_11RandomState_101dirichlet(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_100dirichlet[] = "\n        dirichlet(alpha, size=None)\n\n        Draw samples from the Dirichlet distribution.\n\n        Draw `size` samples of dimension k from a Dirichlet distribution. A\n        Dirichlet-distributed random variable can be seen as a multivariate\n        generalization of a Beta distribution. Dirichlet pdf is the conjugate\n        prior of a multinomial in Bayesian inference.\n\n        Parameters\n        ----------\n        alpha : array\n            Parameter of the distribution (k dimension for sample of\n            dimension k).\n        size : int or tuple of ints, optional\n            Output shape.  If the given shape is, e.g., ``(m, n, k)``, then\n            ``m * n * k`` samples are drawn.  Default is None, in which case a\n            single value is returned.\n\n        Returns\n        -------\n        samples : ndarray,\n            The drawn samples, of shape (size, alpha.ndim).\n\n        Raises\n        -------\n        ValueError\n            If any value in alpha is less than or equal to zero\n\n        Notes\n        -----\n        .. math:: X \\approx \\prod_{i=1}^{k}{x^{\\alpha_i-1}_i}\n\n        Uses the following property for computation: for each dimension,\n        draw a random sample y_i from a standard gamma generator of shape\n        `alpha_i`, then\n        :math:`X = \\frac{1}{\\sum_{i=1}^k{y_i}} (y_1, \\ldots, y_n)` is\n        Dirichlet distributed.\n\n        References\n        ----------\n        .. [1] David McKay, \"Information Theory, Inference and Learning\n               Algorithms,\" chapter 23,\n               http://www.inference.org.uk/mackay/itila/\n        .. [2] Wikipedia, \"Dirichlet distribution\",\n               https://en.wikipedia.org/wiki/Dirichlet_distribution\n\n        Examples\n        --------\n        Taking an example cited in Wikipedia, this distribution can be used if\n        one wanted to cut strings (each of initial length 1.0) into K pieces\n        with different lengths, where each piece"" had, on average, a designated\n        average length, but allowing some variation in the relative sizes of\n        the pieces.\n\n        >>> s = np.random.dirichlet((10, 5, 3), 20).transpose()\n\n        >>> plt.barh(range(20), s[0])\n        >>> plt.barh(range(20), s[1], left=s[0], color='g')\n        >>> plt.barh(range(20), s[2], left=s[0]+s[1], color='r')\n        >>> plt.title(\"Lengths of Strings\")\n\n        ";
+static char __pyx_doc_6mtrand_11RandomState_100dirichlet[] = "\n        dirichlet(alpha, size=None)\n\n        Draw samples from the Dirichlet distribution.\n\n        Draw `size` samples of dimension k from a Dirichlet distribution. A\n        Dirichlet-distributed random variable can be seen as a multivariate\n        generalization of a Beta distribution. Dirichlet pdf is the conjugate\n        prior of a multinomial in Bayesian inference.\n\n        Parameters\n        ----------\n        alpha : array\n            Parameter of the distribution (k dimension for sample of\n            dimension k).\n        size : int or tuple of ints, optional\n            Output shape.  If the given shape is, e.g., ``(m, n, k)``, then\n            ``m * n * k`` samples are drawn.  Default is None, in which case a\n            single value is returned.\n\n        Returns\n        -------\n        samples : ndarray,\n            The drawn samples, of shape (size, alpha.ndim).\n\n        Raises\n        -------\n        ValueError\n            If any value in alpha is less than or equal to zero\n\n        Notes\n        -----\n        .. math:: X \\approx \\prod_{i=1}^{k}{x^{\\alpha_i-1}_i}\n\n        Uses the following property for computation: for each dimension,\n        draw a random sample y_i from a standard gamma generator of shape\n        `alpha_i`, then\n        :math:`X = \\frac{1}{\\sum_{i=1}^k{y_i}} (y_1, \\ldots, y_n)` is\n        Dirichlet distributed.\n\n        References\n        ----------\n        .. [1] David McKay, \"Information Theory, Inference and Learning\n               Algorithms,\" chapter 23,\n               http://www.inference.org.uk/mackay/itila/\n        .. [2] Wikipedia, \"Dirichlet distribution\",\n               https://en.wikipedia.org/wiki/Dirichlet_distribution\n\n        Examples\n        --------\n        Taking an example cited in Wikipedia, this distribution can be used if\n        one wanted to cut strings (each of initial length 1.0) into K pieces\n        with different lengths, where each piece"" had, on average, a designated\n        average length, but allowing some variation in the relative sizes of\n        the pieces.\n\n        >>> s = np.random.dirichlet((10, 5, 3), 20).transpose()\n\n        >>> import matplotlib.pyplot as plt\n        >>> plt.barh(range(20), s[0])\n        >>> plt.barh(range(20), s[1], left=s[0], color='g')\n        >>> plt.barh(range(20), s[2], left=s[0]+s[1], color='r')\n        >>> plt.title(\"Lengths of Strings\")\n\n        ";
 static PyObject *__pyx_pw_6mtrand_11RandomState_101dirichlet(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyObject *__pyx_v_alpha = 0;
   PyObject *__pyx_v_size = 0;
@@ -35640,7 +35703,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_101dirichlet(PyObject *__pyx_v_s
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dirichlet") < 0)) __PYX_ERR(0, 4654, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dirichlet") < 0)) __PYX_ERR(0, 4663, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -35656,7 +35719,7 @@ static PyObject *__pyx_pw_6mtrand_11RandomState_101dirichlet(PyObject *__pyx_v_s
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("dirichlet", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4654, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("dirichlet", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4663, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("mtrand.RandomState.dirichlet", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -35702,24 +35765,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_100dirichlet(struct __pyx_obj_6m
   int __pyx_t_16;
   __Pyx_RefNannySetupContext("dirichlet", 0);
 
-  /* "mtrand.pyx":4748
+  /* "mtrand.pyx":4758
  *         cdef double     acc, invacc
  * 
  *         k           = len(alpha)             # <<<<<<<<<<<<<<
  *         alpha_arr   = <ndarray>PyArray_ContiguousFromObject(alpha, NPY_DOUBLE, 1, 1)
  *         if np.any(np.less_equal(alpha_arr, 0)):
  */
-  __pyx_t_1 = PyObject_Length(__pyx_v_alpha); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 4748, __pyx_L1_error)
+  __pyx_t_1 = PyObject_Length(__pyx_v_alpha); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 4758, __pyx_L1_error)
   __pyx_v_k = __pyx_t_1;
 
-  /* "mtrand.pyx":4749
+  /* "mtrand.pyx":4759
  * 
  *         k           = len(alpha)
  *         alpha_arr   = <ndarray>PyArray_ContiguousFromObject(alpha, NPY_DOUBLE, 1, 1)             # <<<<<<<<<<<<<<
  *         if np.any(np.less_equal(alpha_arr, 0)):
  *             raise ValueError('alpha <= 0')
  */
-  __pyx_t_2 = PyArray_ContiguousFromObject(__pyx_v_alpha, NPY_DOUBLE, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4749, __pyx_L1_error)
+  __pyx_t_2 = PyArray_ContiguousFromObject(__pyx_v_alpha, NPY_DOUBLE, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4759, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_3 = __pyx_t_2;
   __Pyx_INCREF(__pyx_t_3);
@@ -35727,21 +35790,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_100dirichlet(struct __pyx_obj_6m
   __pyx_v_alpha_arr = ((PyArrayObject *)__pyx_t_3);
   __pyx_t_3 = 0;
 
-  /* "mtrand.pyx":4750
+  /* "mtrand.pyx":4760
  *         k           = len(alpha)
  *         alpha_arr   = <ndarray>PyArray_ContiguousFromObject(alpha, NPY_DOUBLE, 1, 1)
  *         if np.any(np.less_equal(alpha_arr, 0)):             # <<<<<<<<<<<<<<
  *             raise ValueError('alpha <= 0')
  *         alpha_data  = <double*>PyArray_DATA(alpha_arr)
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4750, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4760, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_any); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4750, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_any); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4760, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4750, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4760, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_less_equal); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4750, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_less_equal); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4760, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   __pyx_t_5 = NULL;
@@ -35759,7 +35822,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_100dirichlet(struct __pyx_obj_6m
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_6)) {
     PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_alpha_arr), __pyx_int_0};
-    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4750, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4760, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_GOTREF(__pyx_t_2);
   } else
@@ -35767,13 +35830,13 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_100dirichlet(struct __pyx_obj_6m
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
     PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_alpha_arr), __pyx_int_0};
-    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4750, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4760, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_GOTREF(__pyx_t_2);
   } else
   #endif
   {
-    __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4750, __pyx_L1_error)
+    __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4760, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_8);
     if (__pyx_t_5) {
       __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
@@ -35784,7 +35847,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_100dirichlet(struct __pyx_obj_6m
     __Pyx_INCREF(__pyx_int_0);
     __Pyx_GIVEREF(__pyx_int_0);
     PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_int_0);
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4750, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4760, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   }
@@ -35802,27 +35865,27 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_100dirichlet(struct __pyx_obj_6m
   __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2);
   __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4750, __pyx_L1_error)
+  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4760, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 4750, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 4760, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   if (unlikely(__pyx_t_9)) {
 
-    /* "mtrand.pyx":4751
+    /* "mtrand.pyx":4761
  *         alpha_arr   = <ndarray>PyArray_ContiguousFromObject(alpha, NPY_DOUBLE, 1, 1)
  *         if np.any(np.less_equal(alpha_arr, 0)):
  *             raise ValueError('alpha <= 0')             # <<<<<<<<<<<<<<
  *         alpha_data  = <double*>PyArray_DATA(alpha_arr)
  * 
  */
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__73, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4751, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__74, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4761, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __PYX_ERR(0, 4751, __pyx_L1_error)
+    __PYX_ERR(0, 4761, __pyx_L1_error)
 
-    /* "mtrand.pyx":4750
+    /* "mtrand.pyx":4760
  *         k           = len(alpha)
  *         alpha_arr   = <ndarray>PyArray_ContiguousFromObject(alpha, NPY_DOUBLE, 1, 1)
  *         if np.any(np.less_equal(alpha_arr, 0)):             # <<<<<<<<<<<<<<
@@ -35831,7 +35894,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_100dirichlet(struct __pyx_obj_6m
  */
   }
 
-  /* "mtrand.pyx":4752
+  /* "mtrand.pyx":4762
  *         if np.any(np.less_equal(alpha_arr, 0)):
  *             raise ValueError('alpha <= 0')
  *         alpha_data  = <double*>PyArray_DATA(alpha_arr)             # <<<<<<<<<<<<<<
@@ -35840,16 +35903,16 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_100dirichlet(struct __pyx_obj_6m
  */
   __pyx_v_alpha_data = ((double *)PyArray_DATA(__pyx_v_alpha_arr));
 
-  /* "mtrand.pyx":4754
+  /* "mtrand.pyx":4764
  *         alpha_data  = <double*>PyArray_DATA(alpha_arr)
  * 
  *         shape = _shape_from_size(size, k)             # <<<<<<<<<<<<<<
  * 
  *         diric   = np.zeros(shape, np.float64)
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_shape_from_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4754, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_shape_from_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4764, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_2 = __Pyx_PyInt_From_npy_intp(__pyx_v_k); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4754, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_npy_intp(__pyx_v_k); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4764, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_6 = NULL;
   __pyx_t_7 = 0;
@@ -35866,7 +35929,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_100dirichlet(struct __pyx_obj_6m
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_4)) {
     PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_size, __pyx_t_2};
-    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4754, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4764, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -35875,14 +35938,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_100dirichlet(struct __pyx_obj_6m
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
     PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_size, __pyx_t_2};
-    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4754, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4764, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   } else
   #endif
   {
-    __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4754, __pyx_L1_error)
+    __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4764, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_8);
     if (__pyx_t_6) {
       __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
@@ -35893,7 +35956,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_100dirichlet(struct __pyx_obj_6m
     __Pyx_GIVEREF(__pyx_t_2);
     PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_2);
     __pyx_t_2 = 0;
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4754, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4764, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   }
@@ -35901,21 +35964,21 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_100dirichlet(struct __pyx_obj_6m
   __pyx_v_shape = __pyx_t_3;
   __pyx_t_3 = 0;
 
-  /* "mtrand.pyx":4756
+  /* "mtrand.pyx":4766
  *         shape = _shape_from_size(size, k)
  * 
  *         diric   = np.zeros(shape, np.float64)             # <<<<<<<<<<<<<<
  *         val_arr = <ndarray>diric
  *         val_data= <double*>PyArray_DATA(val_arr)
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4756, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4766, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4756, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4766, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4756, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4766, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4756, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4766, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   __pyx_t_4 = NULL;
@@ -35933,7 +35996,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_100dirichlet(struct __pyx_obj_6m
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_8)) {
     PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_shape, __pyx_t_2};
-    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4756, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4766, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -35942,14 +36005,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_100dirichlet(struct __pyx_obj_6m
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
     PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_shape, __pyx_t_2};
-    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4756, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4766, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   } else
   #endif
   {
-    __pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4756, __pyx_L1_error)
+    __pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4766, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     if (__pyx_t_4) {
       __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
@@ -35960,7 +36023,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_100dirichlet(struct __pyx_obj_6m
     __Pyx_GIVEREF(__pyx_t_2);
     PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_t_2);
     __pyx_t_2 = 0;
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4756, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4766, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   }
@@ -35968,7 +36031,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_100dirichlet(struct __pyx_obj_6m
   __pyx_v_diric = __pyx_t_3;
   __pyx_t_3 = 0;
 
-  /* "mtrand.pyx":4757
+  /* "mtrand.pyx":4767
  * 
  *         diric   = np.zeros(shape, np.float64)
  *         val_arr = <ndarray>diric             # <<<<<<<<<<<<<<
@@ -35980,7 +36043,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_100dirichlet(struct __pyx_obj_6m
   __pyx_v_val_arr = ((PyArrayObject *)__pyx_t_3);
   __pyx_t_3 = 0;
 
-  /* "mtrand.pyx":4758
+  /* "mtrand.pyx":4768
  *         diric   = np.zeros(shape, np.float64)
  *         val_arr = <ndarray>diric
  *         val_data= <double*>PyArray_DATA(val_arr)             # <<<<<<<<<<<<<<
@@ -35989,7 +36052,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_100dirichlet(struct __pyx_obj_6m
  */
   __pyx_v_val_data = ((double *)PyArray_DATA(__pyx_v_val_arr));
 
-  /* "mtrand.pyx":4760
+  /* "mtrand.pyx":4770
  *         val_data= <double*>PyArray_DATA(val_arr)
  * 
  *         i = 0             # <<<<<<<<<<<<<<
@@ -35998,7 +36061,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_100dirichlet(struct __pyx_obj_6m
  */
   __pyx_v_i = 0;
 
-  /* "mtrand.pyx":4761
+  /* "mtrand.pyx":4771
  * 
  *         i = 0
  *         totsize = PyArray_SIZE(val_arr)             # <<<<<<<<<<<<<<
@@ -36007,7 +36070,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_100dirichlet(struct __pyx_obj_6m
  */
   __pyx_v_totsize = PyArray_SIZE(__pyx_v_val_arr);
 
-  /* "mtrand.pyx":4762
+  /* "mtrand.pyx":4772
  *         i = 0
  *         totsize = PyArray_SIZE(val_arr)
  *         with self.lock, nogil:             # <<<<<<<<<<<<<<
@@ -36015,9 +36078,9 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_100dirichlet(struct __pyx_obj_6m
  *                 acc = 0.0
  */
   /*with:*/ {
-    __pyx_t_10 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->lock, __pyx_n_s_exit); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4762, __pyx_L1_error)
+    __pyx_t_10 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->lock, __pyx_n_s_exit); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4772, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_10);
-    __pyx_t_8 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->lock, __pyx_n_s_enter); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4762, __pyx_L4_error)
+    __pyx_t_8 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->lock, __pyx_n_s_enter); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4772, __pyx_L4_error)
     __Pyx_GOTREF(__pyx_t_8);
     __pyx_t_6 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
@@ -36031,7 +36094,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_100dirichlet(struct __pyx_obj_6m
     }
     __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4762, __pyx_L4_error)
+    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4772, __pyx_L4_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -36052,7 +36115,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_100dirichlet(struct __pyx_obj_6m
               #endif
               /*try:*/ {
 
-                /* "mtrand.pyx":4763
+                /* "mtrand.pyx":4773
  *         totsize = PyArray_SIZE(val_arr)
  *         with self.lock, nogil:
  *             while i < totsize:             # <<<<<<<<<<<<<<
@@ -36063,7 +36126,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_100dirichlet(struct __pyx_obj_6m
                   __pyx_t_9 = ((__pyx_v_i < __pyx_v_totsize) != 0);
                   if (!__pyx_t_9) break;
 
-                  /* "mtrand.pyx":4764
+                  /* "mtrand.pyx":4774
  *         with self.lock, nogil:
  *             while i < totsize:
  *                 acc = 0.0             # <<<<<<<<<<<<<<
@@ -36072,7 +36135,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_100dirichlet(struct __pyx_obj_6m
  */
                   __pyx_v_acc = 0.0;
 
-                  /* "mtrand.pyx":4765
+                  /* "mtrand.pyx":4775
  *             while i < totsize:
  *                 acc = 0.0
  *                 for j from 0 <= j < k:             # <<<<<<<<<<<<<<
@@ -36082,7 +36145,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_100dirichlet(struct __pyx_obj_6m
                   __pyx_t_14 = __pyx_v_k;
                   for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_14; __pyx_v_j++) {
 
-                    /* "mtrand.pyx":4766
+                    /* "mtrand.pyx":4776
  *                 acc = 0.0
  *                 for j from 0 <= j < k:
  *                     val_data[i+j]   = rk_standard_gamma(self.internal_state,             # <<<<<<<<<<<<<<
@@ -36091,7 +36154,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_100dirichlet(struct __pyx_obj_6m
  */
                     (__pyx_v_val_data[(__pyx_v_i + __pyx_v_j)]) = rk_standard_gamma(__pyx_v_self->internal_state, (__pyx_v_alpha_data[__pyx_v_j]));
 
-                    /* "mtrand.pyx":4768
+                    /* "mtrand.pyx":4778
  *                     val_data[i+j]   = rk_standard_gamma(self.internal_state,
  *                                                         alpha_data[j])
  *                     acc             = acc + val_data[i+j]             # <<<<<<<<<<<<<<
@@ -36101,7 +36164,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_100dirichlet(struct __pyx_obj_6m
                     __pyx_v_acc = (__pyx_v_acc + (__pyx_v_val_data[(__pyx_v_i + __pyx_v_j)]));
                   }
 
-                  /* "mtrand.pyx":4769
+                  /* "mtrand.pyx":4779
  *                                                         alpha_data[j])
  *                     acc             = acc + val_data[i+j]
  *                 invacc  = 1/acc             # <<<<<<<<<<<<<<
@@ -36116,11 +36179,11 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_100dirichlet(struct __pyx_obj_6m
                     #ifdef WITH_THREAD
                     __Pyx_PyGILState_Release(__pyx_gilstate_save);
                     #endif
-                    __PYX_ERR(0, 4769, __pyx_L15_error)
+                    __PYX_ERR(0, 4779, __pyx_L15_error)
                   }
                   __pyx_v_invacc = (1.0 / __pyx_v_acc);
 
-                  /* "mtrand.pyx":4770
+                  /* "mtrand.pyx":4780
  *                     acc             = acc + val_data[i+j]
  *                 invacc  = 1/acc
  *                 for j from 0 <= j < k:             # <<<<<<<<<<<<<<
@@ -36130,7 +36193,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_100dirichlet(struct __pyx_obj_6m
                   __pyx_t_14 = __pyx_v_k;
                   for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_14; __pyx_v_j++) {
 
-                    /* "mtrand.pyx":4771
+                    /* "mtrand.pyx":4781
  *                 invacc  = 1/acc
  *                 for j from 0 <= j < k:
  *                     val_data[i+j]   = val_data[i+j] * invacc             # <<<<<<<<<<<<<<
@@ -36140,7 +36203,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_100dirichlet(struct __pyx_obj_6m
                     (__pyx_v_val_data[(__pyx_v_i + __pyx_v_j)]) = ((__pyx_v_val_data[(__pyx_v_i + __pyx_v_j)]) * __pyx_v_invacc);
                   }
 
-                  /* "mtrand.pyx":4772
+                  /* "mtrand.pyx":4782
  *                 for j from 0 <= j < k:
  *                     val_data[i+j]   = val_data[i+j] * invacc
  *                 i = i + k             # <<<<<<<<<<<<<<
@@ -36151,7 +36214,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_100dirichlet(struct __pyx_obj_6m
                 }
               }
 
-              /* "mtrand.pyx":4762
+              /* "mtrand.pyx":4772
  *         i = 0
  *         totsize = PyArray_SIZE(val_arr)
  *         with self.lock, nogil:             # <<<<<<<<<<<<<<
@@ -36190,20 +36253,20 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_100dirichlet(struct __pyx_obj_6m
         __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
         /*except:*/ {
           __Pyx_AddTraceback("mtrand.RandomState.dirichlet", __pyx_clineno, __pyx_lineno, __pyx_filename);
-          if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(0, 4762, __pyx_L10_except_error)
+          if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(0, 4772, __pyx_L10_except_error)
           __Pyx_GOTREF(__pyx_t_3);
           __Pyx_GOTREF(__pyx_t_8);
           __Pyx_GOTREF(__pyx_t_6);
-          __pyx_t_2 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4762, __pyx_L10_except_error)
+          __pyx_t_2 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4772, __pyx_L10_except_error)
           __Pyx_GOTREF(__pyx_t_2);
           __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_2, NULL);
           __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
           __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-          if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 4762, __pyx_L10_except_error)
+          if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 4772, __pyx_L10_except_error)
           __Pyx_GOTREF(__pyx_t_15);
           __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_15);
           __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
-          if (__pyx_t_9 < 0) __PYX_ERR(0, 4762, __pyx_L10_except_error)
+          if (__pyx_t_9 < 0) __PYX_ERR(0, 4772, __pyx_L10_except_error)
           __pyx_t_16 = ((!(__pyx_t_9 != 0)) != 0);
           if (__pyx_t_16) {
             __Pyx_GIVEREF(__pyx_t_3);
@@ -36211,7 +36274,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_100dirichlet(struct __pyx_obj_6m
             __Pyx_XGIVEREF(__pyx_t_6);
             __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_8, __pyx_t_6);
             __pyx_t_3 = 0; __pyx_t_8 = 0; __pyx_t_6 = 0; 
-            __PYX_ERR(0, 4762, __pyx_L10_except_error)
+            __PYX_ERR(0, 4772, __pyx_L10_except_error)
           }
           __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
           __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -36237,7 +36300,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_100dirichlet(struct __pyx_obj_6m
         if (__pyx_t_10) {
           __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__2, NULL);
           __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-          if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4762, __pyx_L1_error)
+          if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4772, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_13);
           __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
         }
@@ -36252,7 +36315,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_100dirichlet(struct __pyx_obj_6m
     __pyx_L26:;
   }
 
-  /* "mtrand.pyx":4774
+  /* "mtrand.pyx":4784
  *                 i = i + k
  * 
  *         return diric             # <<<<<<<<<<<<<<
@@ -36264,7 +36327,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_100dirichlet(struct __pyx_obj_6m
   __pyx_r = __pyx_v_diric;
   goto __pyx_L0;
 
-  /* "mtrand.pyx":4654
+  /* "mtrand.pyx":4663
  *         return multin
  * 
  *     def dirichlet(self, object alpha, size=None):             # <<<<<<<<<<<<<<
@@ -36292,7 +36355,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_100dirichlet(struct __pyx_obj_6m
   return __pyx_r;
 }
 
-/* "mtrand.pyx":4777
+/* "mtrand.pyx":4787
  * 
  *     # Shuffling and permutations:
  *     def shuffle(self, object x):             # <<<<<<<<<<<<<<
@@ -36343,26 +36406,26 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
   PyObject *__pyx_t_16 = NULL;
   __Pyx_RefNannySetupContext("shuffle", 0);
 
-  /* "mtrand.pyx":4814
+  /* "mtrand.pyx":4824
  *         """
  *         cdef:
  *             npy_intp i, j, n = len(x), stride, itemsize             # <<<<<<<<<<<<<<
  *             char* x_ptr
  *             char* buf_ptr
  */
-  __pyx_t_1 = PyObject_Length(__pyx_v_x); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 4814, __pyx_L1_error)
+  __pyx_t_1 = PyObject_Length(__pyx_v_x); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 4824, __pyx_L1_error)
   __pyx_v_n = __pyx_t_1;
 
-  /* "mtrand.pyx":4818
+  /* "mtrand.pyx":4828
  *             char* buf_ptr
  * 
  *         if type(x) is np.ndarray and x.ndim == 1 and x.size:             # <<<<<<<<<<<<<<
  *             # Fast, statically typed path: shuffle the underlying buffer.
  *             # Only for non-empty, 1d objects of class ndarray (subclasses such
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4818, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4828, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4818, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4828, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_x)) == __pyx_t_4);
@@ -36373,103 +36436,103 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
     __pyx_t_2 = __pyx_t_6;
     goto __pyx_L4_bool_binop_done;
   }
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_ndim); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4818, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_ndim); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4828, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_t_4, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4818, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_t_4, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4828, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 4818, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 4828, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   if (__pyx_t_6) {
   } else {
     __pyx_t_2 = __pyx_t_6;
     goto __pyx_L4_bool_binop_done;
   }
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4818, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4828, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 4818, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 4828, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __pyx_t_2 = __pyx_t_6;
   __pyx_L4_bool_binop_done:;
   if (__pyx_t_2) {
 
-    /* "mtrand.pyx":4822
+    /* "mtrand.pyx":4832
  *             # Only for non-empty, 1d objects of class ndarray (subclasses such
  *             # as MaskedArrays may not support this approach).
  *             x_ptr = <char*><size_t>x.ctypes.data             # <<<<<<<<<<<<<<
  *             stride = x.strides[0]
  *             itemsize = x.dtype.itemsize
  */
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_ctypes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4822, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_ctypes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4832, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_data); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4822, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_data); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4832, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4822, __pyx_L1_error)
+    __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4832, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __pyx_v_x_ptr = ((char *)((size_t)__pyx_t_7));
 
-    /* "mtrand.pyx":4823
+    /* "mtrand.pyx":4833
  *             # as MaskedArrays may not support this approach).
  *             x_ptr = <char*><size_t>x.ctypes.data
  *             stride = x.strides[0]             # <<<<<<<<<<<<<<
  *             itemsize = x.dtype.itemsize
  *             # As the array x could contain python objects we use a buffer
  */
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_strides); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4823, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_strides); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4833, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4823, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4833, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_8 = __Pyx_PyInt_As_npy_intp(__pyx_t_3); if (unlikely((__pyx_t_8 == ((npy_intp)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4823, __pyx_L1_error)
+    __pyx_t_8 = __Pyx_PyInt_As_npy_intp(__pyx_t_3); if (unlikely((__pyx_t_8 == ((npy_intp)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4833, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __pyx_v_stride = __pyx_t_8;
 
-    /* "mtrand.pyx":4824
+    /* "mtrand.pyx":4834
  *             x_ptr = <char*><size_t>x.ctypes.data
  *             stride = x.strides[0]
  *             itemsize = x.dtype.itemsize             # <<<<<<<<<<<<<<
  *             # As the array x could contain python objects we use a buffer
  *             # of bytes for the swaps to avoid leaving one of the objects
  */
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4824, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4834, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4824, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4834, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_8 = __Pyx_PyInt_As_npy_intp(__pyx_t_4); if (unlikely((__pyx_t_8 == ((npy_intp)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4824, __pyx_L1_error)
+    __pyx_t_8 = __Pyx_PyInt_As_npy_intp(__pyx_t_4); if (unlikely((__pyx_t_8 == ((npy_intp)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4834, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __pyx_v_itemsize = __pyx_t_8;
 
-    /* "mtrand.pyx":4829
+    /* "mtrand.pyx":4839
  *             # within the buffer and erroneously decrementing it's refcount
  *             # when the function exits.
  *             buf = np.empty(itemsize, dtype=np.int8) # GC'd at function exit             # <<<<<<<<<<<<<<
  *             buf_ptr = <char*><size_t>buf.ctypes.data
  *             with self.lock:
  */
-    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4829, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4839, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4829, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4839, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_4 = __Pyx_PyInt_From_npy_intp(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4829, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyInt_From_npy_intp(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4839, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4829, __pyx_L1_error)
+    __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4839, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_9);
     __Pyx_GIVEREF(__pyx_t_4);
     PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4);
     __pyx_t_4 = 0;
-    __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4829, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4839, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4829, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4839, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_10);
-    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_int8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4829, __pyx_L1_error)
+    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_int8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4839, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_11);
     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_11) < 0) __PYX_ERR(0, 4829, __pyx_L1_error)
+    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_11) < 0) __PYX_ERR(0, 4839, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-    __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, __pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4829, __pyx_L1_error)
+    __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, __pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4839, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_11);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
@@ -36477,23 +36540,23 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
     __pyx_v_buf = __pyx_t_11;
     __pyx_t_11 = 0;
 
-    /* "mtrand.pyx":4830
+    /* "mtrand.pyx":4840
  *             # when the function exits.
  *             buf = np.empty(itemsize, dtype=np.int8) # GC'd at function exit
  *             buf_ptr = <char*><size_t>buf.ctypes.data             # <<<<<<<<<<<<<<
  *             with self.lock:
  *                 # We trick gcc into providing a specialized implementation for
  */
-    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_buf, __pyx_n_s_ctypes); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4830, __pyx_L1_error)
+    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_buf, __pyx_n_s_ctypes); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4840, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_11);
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_data); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4830, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_data); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4840, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-    __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4830, __pyx_L1_error)
+    __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4840, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __pyx_v_buf_ptr = ((char *)((size_t)__pyx_t_7));
 
-    /* "mtrand.pyx":4831
+    /* "mtrand.pyx":4841
  *             buf = np.empty(itemsize, dtype=np.int8) # GC'd at function exit
  *             buf_ptr = <char*><size_t>buf.ctypes.data
  *             with self.lock:             # <<<<<<<<<<<<<<
@@ -36501,9 +36564,9 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
  *                 # the most common case, yielding a ~33% performance improvement.
  */
     /*with:*/ {
-      __pyx_t_12 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->lock, __pyx_n_s_exit); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4831, __pyx_L1_error)
+      __pyx_t_12 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->lock, __pyx_n_s_exit); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4841, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_12);
-      __pyx_t_11 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->lock, __pyx_n_s_enter); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4831, __pyx_L7_error)
+      __pyx_t_11 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->lock, __pyx_n_s_enter); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4841, __pyx_L7_error)
       __Pyx_GOTREF(__pyx_t_11);
       __pyx_t_9 = NULL;
       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
@@ -36517,7 +36580,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
       }
       __pyx_t_4 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_11);
       __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
-      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4831, __pyx_L7_error)
+      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4841, __pyx_L7_error)
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
@@ -36531,7 +36594,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
           __Pyx_XGOTREF(__pyx_t_15);
           /*try:*/ {
 
-            /* "mtrand.pyx":4835
+            /* "mtrand.pyx":4845
  *                 # the most common case, yielding a ~33% performance improvement.
  *                 # Note that apparently, only one branch can ever be specialized.
  *                 if itemsize == sizeof(npy_intp):             # <<<<<<<<<<<<<<
@@ -36541,18 +36604,18 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
             __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(npy_intp))) != 0);
             if (__pyx_t_2) {
 
-              /* "mtrand.pyx":4836
+              /* "mtrand.pyx":4846
  *                 # Note that apparently, only one branch can ever be specialized.
  *                 if itemsize == sizeof(npy_intp):
  *                     self._shuffle_raw(n, sizeof(npy_intp), stride, x_ptr, buf_ptr)             # <<<<<<<<<<<<<<
  *                 else:
  *                     self._shuffle_raw(n, itemsize, stride, x_ptr, buf_ptr)
  */
-              __pyx_t_4 = __pyx_f_6mtrand_11RandomState__shuffle_raw(__pyx_v_self, __pyx_v_n, (sizeof(npy_intp)), __pyx_v_stride, __pyx_v_x_ptr, __pyx_v_buf_ptr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4836, __pyx_L11_error)
+              __pyx_t_4 = __pyx_f_6mtrand_11RandomState__shuffle_raw(__pyx_v_self, __pyx_v_n, (sizeof(npy_intp)), __pyx_v_stride, __pyx_v_x_ptr, __pyx_v_buf_ptr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4846, __pyx_L11_error)
               __Pyx_GOTREF(__pyx_t_4);
               __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
-              /* "mtrand.pyx":4835
+              /* "mtrand.pyx":4845
  *                 # the most common case, yielding a ~33% performance improvement.
  *                 # Note that apparently, only one branch can ever be specialized.
  *                 if itemsize == sizeof(npy_intp):             # <<<<<<<<<<<<<<
@@ -36562,7 +36625,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
               goto __pyx_L17;
             }
 
-            /* "mtrand.pyx":4838
+            /* "mtrand.pyx":4848
  *                     self._shuffle_raw(n, sizeof(npy_intp), stride, x_ptr, buf_ptr)
  *                 else:
  *                     self._shuffle_raw(n, itemsize, stride, x_ptr, buf_ptr)             # <<<<<<<<<<<<<<
@@ -36570,13 +36633,13 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
  *             buf = np.empty_like(x[0,...])
  */
             /*else*/ {
-              __pyx_t_4 = __pyx_f_6mtrand_11RandomState__shuffle_raw(__pyx_v_self, __pyx_v_n, __pyx_v_itemsize, __pyx_v_stride, __pyx_v_x_ptr, __pyx_v_buf_ptr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4838, __pyx_L11_error)
+              __pyx_t_4 = __pyx_f_6mtrand_11RandomState__shuffle_raw(__pyx_v_self, __pyx_v_n, __pyx_v_itemsize, __pyx_v_stride, __pyx_v_x_ptr, __pyx_v_buf_ptr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4848, __pyx_L11_error)
               __Pyx_GOTREF(__pyx_t_4);
               __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
             }
             __pyx_L17:;
 
-            /* "mtrand.pyx":4831
+            /* "mtrand.pyx":4841
  *             buf = np.empty(itemsize, dtype=np.int8) # GC'd at function exit
  *             buf_ptr = <char*><size_t>buf.ctypes.data
  *             with self.lock:             # <<<<<<<<<<<<<<
@@ -36596,20 +36659,20 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
           __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
           /*except:*/ {
             __Pyx_AddTraceback("mtrand.RandomState.shuffle", __pyx_clineno, __pyx_lineno, __pyx_filename);
-            if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_11, &__pyx_t_9) < 0) __PYX_ERR(0, 4831, __pyx_L13_except_error)
+            if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_11, &__pyx_t_9) < 0) __PYX_ERR(0, 4841, __pyx_L13_except_error)
             __Pyx_GOTREF(__pyx_t_4);
             __Pyx_GOTREF(__pyx_t_11);
             __Pyx_GOTREF(__pyx_t_9);
-            __pyx_t_3 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_11, __pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4831, __pyx_L13_except_error)
+            __pyx_t_3 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_11, __pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4841, __pyx_L13_except_error)
             __Pyx_GOTREF(__pyx_t_3);
             __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_3, NULL);
             __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
             __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-            if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4831, __pyx_L13_except_error)
+            if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4841, __pyx_L13_except_error)
             __Pyx_GOTREF(__pyx_t_16);
             __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_16);
             __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
-            if (__pyx_t_2 < 0) __PYX_ERR(0, 4831, __pyx_L13_except_error)
+            if (__pyx_t_2 < 0) __PYX_ERR(0, 4841, __pyx_L13_except_error)
             __pyx_t_6 = ((!(__pyx_t_2 != 0)) != 0);
             if (__pyx_t_6) {
               __Pyx_GIVEREF(__pyx_t_4);
@@ -36617,7 +36680,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
               __Pyx_XGIVEREF(__pyx_t_9);
               __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_11, __pyx_t_9);
               __pyx_t_4 = 0; __pyx_t_11 = 0; __pyx_t_9 = 0; 
-              __PYX_ERR(0, 4831, __pyx_L13_except_error)
+              __PYX_ERR(0, 4841, __pyx_L13_except_error)
             }
             __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
             __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
@@ -36643,7 +36706,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
           if (__pyx_t_12) {
             __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__2, NULL);
             __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-            if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 4831, __pyx_L1_error)
+            if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 4841, __pyx_L1_error)
             __Pyx_GOTREF(__pyx_t_15);
             __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
           }
@@ -36658,7 +36721,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
       __pyx_L21:;
     }
 
-    /* "mtrand.pyx":4818
+    /* "mtrand.pyx":4828
  *             char* buf_ptr
  * 
  *         if type(x) is np.ndarray and x.ndim == 1 and x.size:             # <<<<<<<<<<<<<<
@@ -36668,19 +36731,19 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
     goto __pyx_L3;
   }
 
-  /* "mtrand.pyx":4839
+  /* "mtrand.pyx":4849
  *                 else:
  *                     self._shuffle_raw(n, itemsize, stride, x_ptr, buf_ptr)
  *         elif isinstance(x, np.ndarray) and x.ndim and x.size:             # <<<<<<<<<<<<<<
  *             buf = np.empty_like(x[0,...])
  *             with self.lock:
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4839, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4849, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4839, __pyx_L1_error)
+  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4849, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_11);
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  __pyx_t_2 = PyObject_IsInstance(__pyx_v_x, __pyx_t_11); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 4839, __pyx_L1_error)
+  __pyx_t_2 = PyObject_IsInstance(__pyx_v_x, __pyx_t_11); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 4849, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
   __pyx_t_5 = (__pyx_t_2 != 0);
   if (__pyx_t_5) {
@@ -36688,36 +36751,36 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
     __pyx_t_6 = __pyx_t_5;
     goto __pyx_L22_bool_binop_done;
   }
-  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_ndim); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4839, __pyx_L1_error)
+  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_ndim); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4849, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_11);
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 4839, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 4849, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
   if (__pyx_t_5) {
   } else {
     __pyx_t_6 = __pyx_t_5;
     goto __pyx_L22_bool_binop_done;
   }
-  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4839, __pyx_L1_error)
+  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4849, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_11);
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 4839, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 4849, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
   __pyx_t_6 = __pyx_t_5;
   __pyx_L22_bool_binop_done:;
   if (__pyx_t_6) {
 
-    /* "mtrand.pyx":4840
+    /* "mtrand.pyx":4850
  *                     self._shuffle_raw(n, itemsize, stride, x_ptr, buf_ptr)
  *         elif isinstance(x, np.ndarray) and x.ndim and x.size:
  *             buf = np.empty_like(x[0,...])             # <<<<<<<<<<<<<<
  *             with self.lock:
  *                 for i in reversed(range(1, n)):
  */
-    __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4840, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4850, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_9);
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4840, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4850, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-    __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_v_x, __pyx_tuple__74); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4840, __pyx_L1_error)
+    __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_v_x, __pyx_tuple__75); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4850, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_9);
     __pyx_t_3 = NULL;
     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
@@ -36732,13 +36795,13 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
     __pyx_t_11 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_9);
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-    if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4840, __pyx_L1_error)
+    if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4850, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_11);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __pyx_v_buf = __pyx_t_11;
     __pyx_t_11 = 0;
 
-    /* "mtrand.pyx":4841
+    /* "mtrand.pyx":4851
  *         elif isinstance(x, np.ndarray) and x.ndim and x.size:
  *             buf = np.empty_like(x[0,...])
  *             with self.lock:             # <<<<<<<<<<<<<<
@@ -36746,9 +36809,9 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
  *                     j = rk_interval(i, self.internal_state)
  */
     /*with:*/ {
-      __pyx_t_12 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->lock, __pyx_n_s_exit); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4841, __pyx_L1_error)
+      __pyx_t_12 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->lock, __pyx_n_s_exit); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4851, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_12);
-      __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->lock, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4841, __pyx_L25_error)
+      __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->lock, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4851, __pyx_L25_error)
       __Pyx_GOTREF(__pyx_t_4);
       __pyx_t_9 = NULL;
       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
@@ -36762,7 +36825,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
       }
       __pyx_t_11 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
       __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
-      if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4841, __pyx_L25_error)
+      if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4851, __pyx_L25_error)
       __Pyx_GOTREF(__pyx_t_11);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
@@ -36776,7 +36839,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
           __Pyx_XGOTREF(__pyx_t_13);
           /*try:*/ {
 
-            /* "mtrand.pyx":4842
+            /* "mtrand.pyx":4852
  *             buf = np.empty_like(x[0,...])
  *             with self.lock:
  *                 for i in reversed(range(1, n)):             # <<<<<<<<<<<<<<
@@ -36786,7 +36849,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
             for (__pyx_t_8 = __pyx_v_n-1; __pyx_t_8 >= 1; __pyx_t_8-=1) {
               __pyx_v_i = __pyx_t_8;
 
-              /* "mtrand.pyx":4843
+              /* "mtrand.pyx":4853
  *             with self.lock:
  *                 for i in reversed(range(1, n)):
  *                     j = rk_interval(i, self.internal_state)             # <<<<<<<<<<<<<<
@@ -36795,41 +36858,41 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
  */
               __pyx_v_j = rk_interval(__pyx_v_i, __pyx_v_self->internal_state);
 
-              /* "mtrand.pyx":4844
+              /* "mtrand.pyx":4854
  *                 for i in reversed(range(1, n)):
  *                     j = rk_interval(i, self.internal_state)
  *                     buf[...] = x[j]             # <<<<<<<<<<<<<<
  *                     x[j] = x[i]
  *                     x[i] = buf
  */
-              __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_j, npy_intp, 1, __Pyx_PyInt_From_npy_intp, 0, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4844, __pyx_L29_error)
+              __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_j, npy_intp, 1, __Pyx_PyInt_From_npy_intp, 0, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4854, __pyx_L29_error)
               __Pyx_GOTREF(__pyx_t_11);
-              if (unlikely(PyObject_SetItem(__pyx_v_buf, Py_Ellipsis, __pyx_t_11) < 0)) __PYX_ERR(0, 4844, __pyx_L29_error)
+              if (unlikely(PyObject_SetItem(__pyx_v_buf, Py_Ellipsis, __pyx_t_11) < 0)) __PYX_ERR(0, 4854, __pyx_L29_error)
               __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
 
-              /* "mtrand.pyx":4845
+              /* "mtrand.pyx":4855
  *                     j = rk_interval(i, self.internal_state)
  *                     buf[...] = x[j]
  *                     x[j] = x[i]             # <<<<<<<<<<<<<<
  *                     x[i] = buf
  *         else:
  */
-              __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_i, npy_intp, 1, __Pyx_PyInt_From_npy_intp, 0, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4845, __pyx_L29_error)
+              __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_i, npy_intp, 1, __Pyx_PyInt_From_npy_intp, 0, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4855, __pyx_L29_error)
               __Pyx_GOTREF(__pyx_t_11);
-              if (unlikely(__Pyx_SetItemInt(__pyx_v_x, __pyx_v_j, __pyx_t_11, npy_intp, 1, __Pyx_PyInt_From_npy_intp, 0, 1, 1) < 0)) __PYX_ERR(0, 4845, __pyx_L29_error)
+              if (unlikely(__Pyx_SetItemInt(__pyx_v_x, __pyx_v_j, __pyx_t_11, npy_intp, 1, __Pyx_PyInt_From_npy_intp, 0, 1, 1) < 0)) __PYX_ERR(0, 4855, __pyx_L29_error)
               __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
 
-              /* "mtrand.pyx":4846
+              /* "mtrand.pyx":4856
  *                     buf[...] = x[j]
  *                     x[j] = x[i]
  *                     x[i] = buf             # <<<<<<<<<<<<<<
  *         else:
  *             # Untyped path.
  */
-              if (unlikely(__Pyx_SetItemInt(__pyx_v_x, __pyx_v_i, __pyx_v_buf, npy_intp, 1, __Pyx_PyInt_From_npy_intp, 0, 1, 1) < 0)) __PYX_ERR(0, 4846, __pyx_L29_error)
+              if (unlikely(__Pyx_SetItemInt(__pyx_v_x, __pyx_v_i, __pyx_v_buf, npy_intp, 1, __Pyx_PyInt_From_npy_intp, 0, 1, 1) < 0)) __PYX_ERR(0, 4856, __pyx_L29_error)
             }
 
-            /* "mtrand.pyx":4841
+            /* "mtrand.pyx":4851
  *         elif isinstance(x, np.ndarray) and x.ndim and x.size:
  *             buf = np.empty_like(x[0,...])
  *             with self.lock:             # <<<<<<<<<<<<<<
@@ -36849,20 +36912,20 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
           __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
           /*except:*/ {
             __Pyx_AddTraceback("mtrand.RandomState.shuffle", __pyx_clineno, __pyx_lineno, __pyx_filename);
-            if (__Pyx_GetException(&__pyx_t_11, &__pyx_t_4, &__pyx_t_9) < 0) __PYX_ERR(0, 4841, __pyx_L31_except_error)
+            if (__Pyx_GetException(&__pyx_t_11, &__pyx_t_4, &__pyx_t_9) < 0) __PYX_ERR(0, 4851, __pyx_L31_except_error)
             __Pyx_GOTREF(__pyx_t_11);
             __Pyx_GOTREF(__pyx_t_4);
             __Pyx_GOTREF(__pyx_t_9);
-            __pyx_t_3 = PyTuple_Pack(3, __pyx_t_11, __pyx_t_4, __pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4841, __pyx_L31_except_error)
+            __pyx_t_3 = PyTuple_Pack(3, __pyx_t_11, __pyx_t_4, __pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4851, __pyx_L31_except_error)
             __Pyx_GOTREF(__pyx_t_3);
             __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_3, NULL);
             __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
             __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-            if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4841, __pyx_L31_except_error)
+            if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4851, __pyx_L31_except_error)
             __Pyx_GOTREF(__pyx_t_16);
             __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_16);
             __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
-            if (__pyx_t_6 < 0) __PYX_ERR(0, 4841, __pyx_L31_except_error)
+            if (__pyx_t_6 < 0) __PYX_ERR(0, 4851, __pyx_L31_except_error)
             __pyx_t_5 = ((!(__pyx_t_6 != 0)) != 0);
             if (__pyx_t_5) {
               __Pyx_GIVEREF(__pyx_t_11);
@@ -36870,7 +36933,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
               __Pyx_XGIVEREF(__pyx_t_9);
               __Pyx_ErrRestoreWithState(__pyx_t_11, __pyx_t_4, __pyx_t_9);
               __pyx_t_11 = 0; __pyx_t_4 = 0; __pyx_t_9 = 0; 
-              __PYX_ERR(0, 4841, __pyx_L31_except_error)
+              __PYX_ERR(0, 4851, __pyx_L31_except_error)
             }
             __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
             __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
@@ -36896,7 +36959,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
           if (__pyx_t_12) {
             __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__2, NULL);
             __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-            if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4841, __pyx_L1_error)
+            if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4851, __pyx_L1_error)
             __Pyx_GOTREF(__pyx_t_13);
             __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
           }
@@ -36911,7 +36974,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
       __pyx_L40:;
     }
 
-    /* "mtrand.pyx":4839
+    /* "mtrand.pyx":4849
  *                 else:
  *                     self._shuffle_raw(n, itemsize, stride, x_ptr, buf_ptr)
  *         elif isinstance(x, np.ndarray) and x.ndim and x.size:             # <<<<<<<<<<<<<<
@@ -36921,7 +36984,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
     goto __pyx_L3;
   }
 
-  /* "mtrand.pyx":4849
+  /* "mtrand.pyx":4859
  *         else:
  *             # Untyped path.
  *             with self.lock:             # <<<<<<<<<<<<<<
@@ -36930,9 +36993,9 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
  */
   /*else*/ {
     /*with:*/ {
-      __pyx_t_12 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->lock, __pyx_n_s_exit); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4849, __pyx_L1_error)
+      __pyx_t_12 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->lock, __pyx_n_s_exit); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4859, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_12);
-      __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->lock, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4849, __pyx_L41_error)
+      __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->lock, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4859, __pyx_L41_error)
       __Pyx_GOTREF(__pyx_t_4);
       __pyx_t_11 = NULL;
       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
@@ -36946,7 +37009,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
       }
       __pyx_t_9 = (__pyx_t_11) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_11) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
       __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
-      if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4849, __pyx_L41_error)
+      if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4859, __pyx_L41_error)
       __Pyx_GOTREF(__pyx_t_9);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
@@ -36960,7 +37023,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
           __Pyx_XGOTREF(__pyx_t_15);
           /*try:*/ {
 
-            /* "mtrand.pyx":4850
+            /* "mtrand.pyx":4860
  *             # Untyped path.
  *             with self.lock:
  *                 for i in reversed(range(1, n)):             # <<<<<<<<<<<<<<
@@ -36970,7 +37033,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
             for (__pyx_t_8 = __pyx_v_n-1; __pyx_t_8 >= 1; __pyx_t_8-=1) {
               __pyx_v_i = __pyx_t_8;
 
-              /* "mtrand.pyx":4851
+              /* "mtrand.pyx":4861
  *             with self.lock:
  *                 for i in reversed(range(1, n)):
  *                     j = rk_interval(i, self.internal_state)             # <<<<<<<<<<<<<<
@@ -36979,24 +37042,24 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
  */
               __pyx_v_j = rk_interval(__pyx_v_i, __pyx_v_self->internal_state);
 
-              /* "mtrand.pyx":4852
+              /* "mtrand.pyx":4862
  *                 for i in reversed(range(1, n)):
  *                     j = rk_interval(i, self.internal_state)
  *                     x[i], x[j] = x[j], x[i]             # <<<<<<<<<<<<<<
  * 
  *     cdef inline _shuffle_raw(self, npy_intp n, npy_intp itemsize,
  */
-              __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_j, npy_intp, 1, __Pyx_PyInt_From_npy_intp, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4852, __pyx_L45_error)
+              __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_j, npy_intp, 1, __Pyx_PyInt_From_npy_intp, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4862, __pyx_L45_error)
               __Pyx_GOTREF(__pyx_t_9);
-              __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_i, npy_intp, 1, __Pyx_PyInt_From_npy_intp, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4852, __pyx_L45_error)
+              __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_i, npy_intp, 1, __Pyx_PyInt_From_npy_intp, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4862, __pyx_L45_error)
               __Pyx_GOTREF(__pyx_t_4);
-              if (unlikely(__Pyx_SetItemInt(__pyx_v_x, __pyx_v_i, __pyx_t_9, npy_intp, 1, __Pyx_PyInt_From_npy_intp, 0, 1, 1) < 0)) __PYX_ERR(0, 4852, __pyx_L45_error)
+              if (unlikely(__Pyx_SetItemInt(__pyx_v_x, __pyx_v_i, __pyx_t_9, npy_intp, 1, __Pyx_PyInt_From_npy_intp, 0, 1, 1) < 0)) __PYX_ERR(0, 4862, __pyx_L45_error)
               __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-              if (unlikely(__Pyx_SetItemInt(__pyx_v_x, __pyx_v_j, __pyx_t_4, npy_intp, 1, __Pyx_PyInt_From_npy_intp, 0, 1, 1) < 0)) __PYX_ERR(0, 4852, __pyx_L45_error)
+              if (unlikely(__Pyx_SetItemInt(__pyx_v_x, __pyx_v_j, __pyx_t_4, npy_intp, 1, __Pyx_PyInt_From_npy_intp, 0, 1, 1) < 0)) __PYX_ERR(0, 4862, __pyx_L45_error)
               __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
             }
 
-            /* "mtrand.pyx":4849
+            /* "mtrand.pyx":4859
  *         else:
  *             # Untyped path.
  *             with self.lock:             # <<<<<<<<<<<<<<
@@ -37016,20 +37079,20 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
           __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
           /*except:*/ {
             __Pyx_AddTraceback("mtrand.RandomState.shuffle", __pyx_clineno, __pyx_lineno, __pyx_filename);
-            if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_9, &__pyx_t_11) < 0) __PYX_ERR(0, 4849, __pyx_L47_except_error)
+            if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_9, &__pyx_t_11) < 0) __PYX_ERR(0, 4859, __pyx_L47_except_error)
             __Pyx_GOTREF(__pyx_t_4);
             __Pyx_GOTREF(__pyx_t_9);
             __Pyx_GOTREF(__pyx_t_11);
-            __pyx_t_3 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_9, __pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4849, __pyx_L47_except_error)
+            __pyx_t_3 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_9, __pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4859, __pyx_L47_except_error)
             __Pyx_GOTREF(__pyx_t_3);
             __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_3, NULL);
             __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
             __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-            if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4849, __pyx_L47_except_error)
+            if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 4859, __pyx_L47_except_error)
             __Pyx_GOTREF(__pyx_t_16);
             __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_16);
             __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
-            if (__pyx_t_5 < 0) __PYX_ERR(0, 4849, __pyx_L47_except_error)
+            if (__pyx_t_5 < 0) __PYX_ERR(0, 4859, __pyx_L47_except_error)
             __pyx_t_6 = ((!(__pyx_t_5 != 0)) != 0);
             if (__pyx_t_6) {
               __Pyx_GIVEREF(__pyx_t_4);
@@ -37037,7 +37100,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
               __Pyx_XGIVEREF(__pyx_t_11);
               __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_9, __pyx_t_11);
               __pyx_t_4 = 0; __pyx_t_9 = 0; __pyx_t_11 = 0; 
-              __PYX_ERR(0, 4849, __pyx_L47_except_error)
+              __PYX_ERR(0, 4859, __pyx_L47_except_error)
             }
             __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
             __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
@@ -37063,7 +37126,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
           if (__pyx_t_12) {
             __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__2, NULL);
             __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-            if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 4849, __pyx_L1_error)
+            if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 4859, __pyx_L1_error)
             __Pyx_GOTREF(__pyx_t_15);
             __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
           }
@@ -37080,7 +37143,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
   }
   __pyx_L3:;
 
-  /* "mtrand.pyx":4777
+  /* "mtrand.pyx":4787
  * 
  *     # Shuffling and permutations:
  *     def shuffle(self, object x):             # <<<<<<<<<<<<<<
@@ -37106,7 +37169,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtr
   return __pyx_r;
 }
 
-/* "mtrand.pyx":4854
+/* "mtrand.pyx":4864
  *                     x[i], x[j] = x[j], x[i]
  * 
  *     cdef inline _shuffle_raw(self, npy_intp n, npy_intp itemsize,             # <<<<<<<<<<<<<<
@@ -37123,7 +37186,7 @@ static CYTHON_INLINE PyObject *__pyx_f_6mtrand_11RandomState__shuffle_raw(struct
   int __pyx_t_2;
   __Pyx_RefNannySetupContext("_shuffle_raw", 0);
 
-  /* "mtrand.pyx":4857
+  /* "mtrand.pyx":4867
  *                              npy_intp stride, char* data, char* buf):
  *         cdef npy_intp i, j
  *         for i in reversed(range(1, n)):             # <<<<<<<<<<<<<<
@@ -37133,7 +37196,7 @@ static CYTHON_INLINE PyObject *__pyx_f_6mtrand_11RandomState__shuffle_raw(struct
   for (__pyx_t_1 = __pyx_v_n-1; __pyx_t_1 >= 1; __pyx_t_1-=1) {
     __pyx_v_i = __pyx_t_1;
 
-    /* "mtrand.pyx":4858
+    /* "mtrand.pyx":4868
  *         cdef npy_intp i, j
  *         for i in reversed(range(1, n)):
  *             j = rk_interval(i, self.internal_state)             # <<<<<<<<<<<<<<
@@ -37142,7 +37205,7 @@ static CYTHON_INLINE PyObject *__pyx_f_6mtrand_11RandomState__shuffle_raw(struct
  */
     __pyx_v_j = rk_interval(__pyx_v_i, __pyx_v_self->internal_state);
 
-    /* "mtrand.pyx":4859
+    /* "mtrand.pyx":4869
  *         for i in reversed(range(1, n)):
  *             j = rk_interval(i, self.internal_state)
  *             if i == j : continue # i == j is not needed and memcpy is undefined.             # <<<<<<<<<<<<<<
@@ -37154,7 +37217,7 @@ static CYTHON_INLINE PyObject *__pyx_f_6mtrand_11RandomState__shuffle_raw(struct
       goto __pyx_L3_continue;
     }
 
-    /* "mtrand.pyx":4860
+    /* "mtrand.pyx":4870
  *             j = rk_interval(i, self.internal_state)
  *             if i == j : continue # i == j is not needed and memcpy is undefined.
  *             string.memcpy(buf, data + j * stride, itemsize)             # <<<<<<<<<<<<<<
@@ -37163,7 +37226,7 @@ static CYTHON_INLINE PyObject *__pyx_f_6mtrand_11RandomState__shuffle_raw(struct
  */
     (void)(memcpy(__pyx_v_buf, (__pyx_v_data + (__pyx_v_j * __pyx_v_stride)), __pyx_v_itemsize));
 
-    /* "mtrand.pyx":4861
+    /* "mtrand.pyx":4871
  *             if i == j : continue # i == j is not needed and memcpy is undefined.
  *             string.memcpy(buf, data + j * stride, itemsize)
  *             string.memcpy(data + j * stride, data + i * stride, itemsize)             # <<<<<<<<<<<<<<
@@ -37172,7 +37235,7 @@ static CYTHON_INLINE PyObject *__pyx_f_6mtrand_11RandomState__shuffle_raw(struct
  */
     (void)(memcpy((__pyx_v_data + (__pyx_v_j * __pyx_v_stride)), (__pyx_v_data + (__pyx_v_i * __pyx_v_stride)), __pyx_v_itemsize));
 
-    /* "mtrand.pyx":4862
+    /* "mtrand.pyx":4872
  *             string.memcpy(buf, data + j * stride, itemsize)
  *             string.memcpy(data + j * stride, data + i * stride, itemsize)
  *             string.memcpy(data + i * stride, buf, itemsize)             # <<<<<<<<<<<<<<
@@ -37183,7 +37246,7 @@ static CYTHON_INLINE PyObject *__pyx_f_6mtrand_11RandomState__shuffle_raw(struct
     __pyx_L3_continue:;
   }
 
-  /* "mtrand.pyx":4854
+  /* "mtrand.pyx":4864
  *                     x[i], x[j] = x[j], x[i]
  * 
  *     cdef inline _shuffle_raw(self, npy_intp n, npy_intp itemsize,             # <<<<<<<<<<<<<<
@@ -37198,7 +37261,7 @@ static CYTHON_INLINE PyObject *__pyx_f_6mtrand_11RandomState__shuffle_raw(struct
   return __pyx_r;
 }
 
-/* "mtrand.pyx":4864
+/* "mtrand.pyx":4874
  *             string.memcpy(data + i * stride, buf, itemsize)
  * 
  *     def permutation(self, object x):             # <<<<<<<<<<<<<<
@@ -37236,16 +37299,16 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_104permutation(struct __pyx_obj_
   PyObject *__pyx_t_9 = NULL;
   __Pyx_RefNannySetupContext("permutation", 0);
 
-  /* "mtrand.pyx":4900
+  /* "mtrand.pyx":4910
  * 
  *         """
  *         if isinstance(x, (int, long, np.integer)):             # <<<<<<<<<<<<<<
  *             arr = np.arange(x)
  *             self.shuffle(arr)
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4900, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4910, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_integer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4900, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_integer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4910, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_t_4 = PyInt_Check(__pyx_v_x); 
@@ -37270,16 +37333,16 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_104permutation(struct __pyx_obj_
   __pyx_t_5 = (__pyx_t_3 != 0);
   if (__pyx_t_5) {
 
-    /* "mtrand.pyx":4901
+    /* "mtrand.pyx":4911
  *         """
  *         if isinstance(x, (int, long, np.integer)):
  *             arr = np.arange(x)             # <<<<<<<<<<<<<<
  *             self.shuffle(arr)
  *             return arr
  */
-    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4901, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4911, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_arange); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4901, __pyx_L1_error)
+    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_arange); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4911, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __pyx_t_1 = NULL;
@@ -37294,20 +37357,20 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_104permutation(struct __pyx_obj_
     }
     __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_1, __pyx_v_x) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_x);
     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
-    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4901, __pyx_L1_error)
+    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4911, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
     __pyx_v_arr = __pyx_t_2;
     __pyx_t_2 = 0;
 
-    /* "mtrand.pyx":4902
+    /* "mtrand.pyx":4912
  *         if isinstance(x, (int, long, np.integer)):
  *             arr = np.arange(x)
  *             self.shuffle(arr)             # <<<<<<<<<<<<<<
  *             return arr
  * 
  */
-    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shuffle); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4902, __pyx_L1_error)
+    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shuffle); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4912, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     __pyx_t_1 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
@@ -37321,12 +37384,12 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_104permutation(struct __pyx_obj_
     }
     __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_1, __pyx_v_arr) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_arr);
     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
-    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4902, __pyx_L1_error)
+    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4912, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-    /* "mtrand.pyx":4903
+    /* "mtrand.pyx":4913
  *             arr = np.arange(x)
  *             self.shuffle(arr)
  *             return arr             # <<<<<<<<<<<<<<
@@ -37338,7 +37401,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_104permutation(struct __pyx_obj_
     __pyx_r = __pyx_v_arr;
     goto __pyx_L0;
 
-    /* "mtrand.pyx":4900
+    /* "mtrand.pyx":4910
  * 
  *         """
  *         if isinstance(x, (int, long, np.integer)):             # <<<<<<<<<<<<<<
@@ -37347,16 +37410,16 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_104permutation(struct __pyx_obj_
  */
   }
 
-  /* "mtrand.pyx":4905
+  /* "mtrand.pyx":4915
  *             return arr
  * 
  *         arr = np.asarray(x)             # <<<<<<<<<<<<<<
  * 
  *         # shuffle has fast-path for 1-d
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4905, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4915, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4905, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4915, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   __pyx_t_6 = NULL;
@@ -37371,38 +37434,38 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_104permutation(struct __pyx_obj_
   }
   __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_v_x) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_x);
   __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4905, __pyx_L1_error)
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4915, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_v_arr = __pyx_t_2;
   __pyx_t_2 = 0;
 
-  /* "mtrand.pyx":4908
+  /* "mtrand.pyx":4918
  * 
  *         # shuffle has fast-path for 1-d
  *         if arr.ndim == 1:             # <<<<<<<<<<<<<<
  *             # Return a copy if same memory
  *             if np.may_share_memory(arr, x):
  */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4908, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4918, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_2, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4908, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_2, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4918, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 4908, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 4918, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (__pyx_t_5) {
 
-    /* "mtrand.pyx":4910
+    /* "mtrand.pyx":4920
  *         if arr.ndim == 1:
  *             # Return a copy if same memory
  *             if np.may_share_memory(arr, x):             # <<<<<<<<<<<<<<
  *                 arr = np.array(arr)
  *             self.shuffle(arr)
  */
-    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4910, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4920, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_may_share_memory); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4910, __pyx_L1_error)
+    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_may_share_memory); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4920, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __pyx_t_2 = NULL;
@@ -37420,7 +37483,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_104permutation(struct __pyx_obj_
     #if CYTHON_FAST_PYCALL
     if (PyFunction_Check(__pyx_t_6)) {
       PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_arr, __pyx_v_x};
-      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4910, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4920, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
       __Pyx_GOTREF(__pyx_t_1);
     } else
@@ -37428,13 +37491,13 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_104permutation(struct __pyx_obj_
     #if CYTHON_FAST_PYCCALL
     if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
       PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_arr, __pyx_v_x};
-      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4910, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4920, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
       __Pyx_GOTREF(__pyx_t_1);
     } else
     #endif
     {
-      __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4910, __pyx_L1_error)
+      __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4920, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_8);
       if (__pyx_t_2) {
         __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); __pyx_t_2 = NULL;
@@ -37445,25 +37508,25 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_104permutation(struct __pyx_obj_
       __Pyx_INCREF(__pyx_v_x);
       __Pyx_GIVEREF(__pyx_v_x);
       PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_x);
-      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4910, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4920, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
     }
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 4910, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 4920, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     if (__pyx_t_5) {
 
-      /* "mtrand.pyx":4911
+      /* "mtrand.pyx":4921
  *             # Return a copy if same memory
  *             if np.may_share_memory(arr, x):
  *                 arr = np.array(arr)             # <<<<<<<<<<<<<<
  *             self.shuffle(arr)
  *             return arr
  */
-      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4911, __pyx_L1_error)
+      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4921, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_6);
-      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_array); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4911, __pyx_L1_error)
+      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_array); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4921, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_8);
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
       __pyx_t_6 = NULL;
@@ -37478,13 +37541,13 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_104permutation(struct __pyx_obj_
       }
       __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_6, __pyx_v_arr) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_arr);
       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4911, __pyx_L1_error)
+      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4921, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
       __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_1);
       __pyx_t_1 = 0;
 
-      /* "mtrand.pyx":4910
+      /* "mtrand.pyx":4920
  *         if arr.ndim == 1:
  *             # Return a copy if same memory
  *             if np.may_share_memory(arr, x):             # <<<<<<<<<<<<<<
@@ -37493,14 +37556,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_104permutation(struct __pyx_obj_
  */
     }
 
-    /* "mtrand.pyx":4912
+    /* "mtrand.pyx":4922
  *             if np.may_share_memory(arr, x):
  *                 arr = np.array(arr)
  *             self.shuffle(arr)             # <<<<<<<<<<<<<<
  *             return arr
  * 
  */
-    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shuffle); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4912, __pyx_L1_error)
+    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shuffle); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4922, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_8);
     __pyx_t_6 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
@@ -37514,12 +37577,12 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_104permutation(struct __pyx_obj_
     }
     __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_6, __pyx_v_arr) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_arr);
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4912, __pyx_L1_error)
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4922, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-    /* "mtrand.pyx":4913
+    /* "mtrand.pyx":4923
  *                 arr = np.array(arr)
  *             self.shuffle(arr)
  *             return arr             # <<<<<<<<<<<<<<
@@ -37531,7 +37594,7 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_104permutation(struct __pyx_obj_
     __pyx_r = __pyx_v_arr;
     goto __pyx_L0;
 
-    /* "mtrand.pyx":4908
+    /* "mtrand.pyx":4918
  * 
  *         # shuffle has fast-path for 1-d
  *         if arr.ndim == 1:             # <<<<<<<<<<<<<<
@@ -37540,38 +37603,38 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_104permutation(struct __pyx_obj_
  */
   }
 
-  /* "mtrand.pyx":4916
+  /* "mtrand.pyx":4926
  * 
  *         # Shuffle index array, dtype to ensure fast path
  *         idx = np.arange(arr.shape[0], dtype=np.intp)             # <<<<<<<<<<<<<<
  *         self.shuffle(idx)
  *         return arr[idx]
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4916, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4926, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_arange); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4916, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_arange); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4926, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4916, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4926, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4916, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4926, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4916, __pyx_L1_error)
+  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4926, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_6);
   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
   __pyx_t_6 = 0;
-  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4916, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4926, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
-  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4916, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4926, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_intp); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4916, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_intp); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4926, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_9) < 0) __PYX_ERR(0, 4916, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_9) < 0) __PYX_ERR(0, 4926, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4916, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4926, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -37579,14 +37642,14 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_104permutation(struct __pyx_obj_
   __pyx_v_idx = __pyx_t_9;
   __pyx_t_9 = 0;
 
-  /* "mtrand.pyx":4917
+  /* "mtrand.pyx":4927
  *         # Shuffle index array, dtype to ensure fast path
  *         idx = np.arange(arr.shape[0], dtype=np.intp)
  *         self.shuffle(idx)             # <<<<<<<<<<<<<<
  *         return arr[idx]
  * 
  */
-  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shuffle); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4917, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shuffle); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4927, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
   __pyx_t_1 = NULL;
   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
@@ -37600,12 +37663,12 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_104permutation(struct __pyx_obj_
   }
   __pyx_t_9 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_1, __pyx_v_idx) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_idx);
   __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4917, __pyx_L1_error)
+  if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4927, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-  /* "mtrand.pyx":4918
+  /* "mtrand.pyx":4928
  *         idx = np.arange(arr.shape[0], dtype=np.intp)
  *         self.shuffle(idx)
  *         return arr[idx]             # <<<<<<<<<<<<<<
@@ -37613,13 +37676,13 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_104permutation(struct __pyx_obj_
  * 
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_v_arr, __pyx_v_idx); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4918, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_v_arr, __pyx_v_idx); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4928, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __pyx_r = __pyx_t_9;
   __pyx_t_9 = 0;
   goto __pyx_L0;
 
-  /* "mtrand.pyx":4864
+  /* "mtrand.pyx":4874
  *             string.memcpy(data + i * stride, buf, itemsize)
  * 
  *     def permutation(self, object x):             # <<<<<<<<<<<<<<
@@ -37875,50 +37938,50 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
   {&__pyx_n_s_MT19937, __pyx_k_MT19937, sizeof(__pyx_k_MT19937), 0, 0, 1, 1},
   {&__pyx_n_s_OverflowError, __pyx_k_OverflowError, sizeof(__pyx_k_OverflowError), 0, 0, 1, 1},
   {&__pyx_n_s_RandomState, __pyx_k_RandomState, sizeof(__pyx_k_RandomState), 0, 0, 1, 1},
-  {&__pyx_kp_u_RandomState_binomial_line_3696, __pyx_k_RandomState_binomial_line_3696, sizeof(__pyx_k_RandomState_binomial_line_3696), 0, 1, 0, 0},
+  {&__pyx_kp_u_RandomState_binomial_line_3703, __pyx_k_RandomState_binomial_line_3703, sizeof(__pyx_k_RandomState_binomial_line_3703), 0, 1, 0, 0},
   {&__pyx_kp_u_RandomState_bytes_line_1003, __pyx_k_RandomState_bytes_line_1003, sizeof(__pyx_k_RandomState_bytes_line_1003), 0, 1, 0, 0},
-  {&__pyx_kp_u_RandomState_chisquare_line_2204, __pyx_k_RandomState_chisquare_line_2204, sizeof(__pyx_k_RandomState_chisquare_line_2204), 0, 1, 0, 0},
+  {&__pyx_kp_u_RandomState_chisquare_line_2208, __pyx_k_RandomState_chisquare_line_2208, sizeof(__pyx_k_RandomState_chisquare_line_2208), 0, 1, 0, 0},
   {&__pyx_kp_u_RandomState_choice_line_1032, __pyx_k_RandomState_choice_line_1032, sizeof(__pyx_k_RandomState_choice_line_1032), 0, 1, 0, 0},
   {&__pyx_n_s_RandomState_ctor, __pyx_k_RandomState_ctor, sizeof(__pyx_k_RandomState_ctor), 0, 0, 1, 1},
-  {&__pyx_kp_u_RandomState_dirichlet_line_4654, __pyx_k_RandomState_dirichlet_line_4654, sizeof(__pyx_k_RandomState_dirichlet_line_4654), 0, 1, 0, 0},
-  {&__pyx_kp_u_RandomState_f_line_1996, __pyx_k_RandomState_f_line_1996, sizeof(__pyx_k_RandomState_f_line_1996), 0, 1, 0, 0},
-  {&__pyx_kp_u_RandomState_gamma_line_1900, __pyx_k_RandomState_gamma_line_1900, sizeof(__pyx_k_RandomState_gamma_line_1900), 0, 1, 0, 0},
-  {&__pyx_kp_u_RandomState_geometric_line_4092, __pyx_k_RandomState_geometric_line_4092, sizeof(__pyx_k_RandomState_geometric_line_4092), 0, 1, 0, 0},
-  {&__pyx_kp_u_RandomState_gumbel_line_3088, __pyx_k_RandomState_gumbel_line_3088, sizeof(__pyx_k_RandomState_gumbel_line_3088), 0, 1, 0, 0},
+  {&__pyx_kp_u_RandomState_dirichlet_line_4663, __pyx_k_RandomState_dirichlet_line_4663, sizeof(__pyx_k_RandomState_dirichlet_line_4663), 0, 1, 0, 0},
+  {&__pyx_kp_u_RandomState_f_line_1999, __pyx_k_RandomState_f_line_1999, sizeof(__pyx_k_RandomState_f_line_1999), 0, 1, 0, 0},
+  {&__pyx_kp_u_RandomState_gamma_line_1903, __pyx_k_RandomState_gamma_line_1903, sizeof(__pyx_k_RandomState_gamma_line_1903), 0, 1, 0, 0},
+  {&__pyx_kp_u_RandomState_geometric_line_4099, __pyx_k_RandomState_geometric_line_4099, sizeof(__pyx_k_RandomState_geometric_line_4099), 0, 1, 0, 0},
+  {&__pyx_kp_u_RandomState_gumbel_line_3093, __pyx_k_RandomState_gumbel_line_3093, sizeof(__pyx_k_RandomState_gumbel_line_3093), 0, 1, 0, 0},
   {&__pyx_kp_u_RandomState_hypergeometric_line, __pyx_k_RandomState_hypergeometric_line, sizeof(__pyx_k_RandomState_hypergeometric_line), 0, 1, 0, 0},
-  {&__pyx_kp_u_RandomState_laplace_line_2990, __pyx_k_RandomState_laplace_line_2990, sizeof(__pyx_k_RandomState_laplace_line_2990), 0, 1, 0, 0},
-  {&__pyx_kp_u_RandomState_logistic_line_3219, __pyx_k_RandomState_logistic_line_3219, sizeof(__pyx_k_RandomState_logistic_line_3219), 0, 1, 0, 0},
-  {&__pyx_kp_u_RandomState_lognormal_line_3312, __pyx_k_RandomState_lognormal_line_3312, sizeof(__pyx_k_RandomState_lognormal_line_3312), 0, 1, 0, 0},
-  {&__pyx_kp_u_RandomState_logseries_line_4282, __pyx_k_RandomState_logseries_line_4282, sizeof(__pyx_k_RandomState_logseries_line_4282), 0, 1, 0, 0},
-  {&__pyx_kp_u_RandomState_multinomial_line_454, __pyx_k_RandomState_multinomial_line_454, sizeof(__pyx_k_RandomState_multinomial_line_454), 0, 1, 0, 0},
+  {&__pyx_kp_u_RandomState_laplace_line_2995, __pyx_k_RandomState_laplace_line_2995, sizeof(__pyx_k_RandomState_laplace_line_2995), 0, 1, 0, 0},
+  {&__pyx_kp_u_RandomState_logistic_line_3224, __pyx_k_RandomState_logistic_line_3224, sizeof(__pyx_k_RandomState_logistic_line_3224), 0, 1, 0, 0},
+  {&__pyx_kp_u_RandomState_lognormal_line_3318, __pyx_k_RandomState_lognormal_line_3318, sizeof(__pyx_k_RandomState_lognormal_line_3318), 0, 1, 0, 0},
+  {&__pyx_kp_u_RandomState_logseries_line_4290, __pyx_k_RandomState_logseries_line_4290, sizeof(__pyx_k_RandomState_logseries_line_4290), 0, 1, 0, 0},
+  {&__pyx_kp_u_RandomState_multinomial_line_455, __pyx_k_RandomState_multinomial_line_455, sizeof(__pyx_k_RandomState_multinomial_line_455), 0, 1, 0, 0},
   {&__pyx_kp_u_RandomState_multivariate_normal, __pyx_k_RandomState_multivariate_normal, sizeof(__pyx_k_RandomState_multivariate_normal), 0, 1, 0, 0},
   {&__pyx_kp_u_RandomState_negative_binomial_li, __pyx_k_RandomState_negative_binomial_li, sizeof(__pyx_k_RandomState_negative_binomial_li), 0, 1, 0, 0},
   {&__pyx_kp_u_RandomState_noncentral_chisquare, __pyx_k_RandomState_noncentral_chisquare, sizeof(__pyx_k_RandomState_noncentral_chisquare), 0, 1, 0, 0},
   {&__pyx_kp_u_RandomState_noncentral_f_line_21, __pyx_k_RandomState_noncentral_f_line_21, sizeof(__pyx_k_RandomState_noncentral_f_line_21), 0, 1, 0, 0},
-  {&__pyx_kp_u_RandomState_normal_line_1551, __pyx_k_RandomState_normal_line_1551, sizeof(__pyx_k_RandomState_normal_line_1551), 0, 1, 0, 0},
-  {&__pyx_kp_u_RandomState_pareto_line_2659, __pyx_k_RandomState_pareto_line_2659, sizeof(__pyx_k_RandomState_pareto_line_2659), 0, 1, 0, 0},
-  {&__pyx_kp_u_RandomState_permutation_line_486, __pyx_k_RandomState_permutation_line_486, sizeof(__pyx_k_RandomState_permutation_line_486), 0, 1, 0, 0},
-  {&__pyx_kp_u_RandomState_poisson_line_3911, __pyx_k_RandomState_poisson_line_3911, sizeof(__pyx_k_RandomState_poisson_line_3911), 0, 1, 0, 0},
-  {&__pyx_kp_u_RandomState_power_line_2879, __pyx_k_RandomState_power_line_2879, sizeof(__pyx_k_RandomState_power_line_2879), 0, 1, 0, 0},
-  {&__pyx_kp_u_RandomState_rand_line_1320, __pyx_k_RandomState_rand_line_1320, sizeof(__pyx_k_RandomState_rand_line_1320), 0, 1, 0, 0},
+  {&__pyx_kp_u_RandomState_normal_line_1554, __pyx_k_RandomState_normal_line_1554, sizeof(__pyx_k_RandomState_normal_line_1554), 0, 1, 0, 0},
+  {&__pyx_kp_u_RandomState_pareto_line_2664, __pyx_k_RandomState_pareto_line_2664, sizeof(__pyx_k_RandomState_pareto_line_2664), 0, 1, 0, 0},
+  {&__pyx_kp_u_RandomState_permutation_line_487, __pyx_k_RandomState_permutation_line_487, sizeof(__pyx_k_RandomState_permutation_line_487), 0, 1, 0, 0},
+  {&__pyx_kp_u_RandomState_poisson_line_3918, __pyx_k_RandomState_poisson_line_3918, sizeof(__pyx_k_RandomState_poisson_line_3918), 0, 1, 0, 0},
+  {&__pyx_kp_u_RandomState_power_line_2884, __pyx_k_RandomState_power_line_2884, sizeof(__pyx_k_RandomState_power_line_2884), 0, 1, 0, 0},
+  {&__pyx_kp_u_RandomState_rand_line_1323, __pyx_k_RandomState_rand_line_1323, sizeof(__pyx_k_RandomState_rand_line_1323), 0, 1, 0, 0},
   {&__pyx_kp_u_RandomState_randint_line_910, __pyx_k_RandomState_randint_line_910, sizeof(__pyx_k_RandomState_randint_line_910), 0, 1, 0, 0},
-  {&__pyx_kp_u_RandomState_randn_line_1364, __pyx_k_RandomState_randn_line_1364, sizeof(__pyx_k_RandomState_randn_line_1364), 0, 1, 0, 0},
+  {&__pyx_kp_u_RandomState_randn_line_1367, __pyx_k_RandomState_randn_line_1367, sizeof(__pyx_k_RandomState_randn_line_1367), 0, 1, 0, 0},
   {&__pyx_kp_u_RandomState_random_integers_line, __pyx_k_RandomState_random_integers_line, sizeof(__pyx_k_RandomState_random_integers_line), 0, 1, 0, 0},
   {&__pyx_kp_u_RandomState_random_sample_line_8, __pyx_k_RandomState_random_sample_line_8, sizeof(__pyx_k_RandomState_random_sample_line_8), 0, 1, 0, 0},
-  {&__pyx_kp_u_RandomState_rayleigh_line_3436, __pyx_k_RandomState_rayleigh_line_3436, sizeof(__pyx_k_RandomState_rayleigh_line_3436), 0, 1, 0, 0},
-  {&__pyx_kp_u_RandomState_shuffle_line_4777, __pyx_k_RandomState_shuffle_line_4777, sizeof(__pyx_k_RandomState_shuffle_line_4777), 0, 1, 0, 0},
+  {&__pyx_kp_u_RandomState_rayleigh_line_3442, __pyx_k_RandomState_rayleigh_line_3442, sizeof(__pyx_k_RandomState_rayleigh_line_3442), 0, 1, 0, 0},
+  {&__pyx_kp_u_RandomState_shuffle_line_4787, __pyx_k_RandomState_shuffle_line_4787, sizeof(__pyx_k_RandomState_shuffle_line_4787), 0, 1, 0, 0},
   {&__pyx_kp_u_RandomState_standard_cauchy_line, __pyx_k_RandomState_standard_cauchy_line, sizeof(__pyx_k_RandomState_standard_cauchy_line), 0, 1, 0, 0},
   {&__pyx_kp_u_RandomState_standard_exponential, __pyx_k_RandomState_standard_exponential, sizeof(__pyx_k_RandomState_standard_exponential), 0, 1, 0, 0},
   {&__pyx_kp_u_RandomState_standard_gamma_line, __pyx_k_RandomState_standard_gamma_line, sizeof(__pyx_k_RandomState_standard_gamma_line), 0, 1, 0, 0},
   {&__pyx_kp_u_RandomState_standard_normal_line, __pyx_k_RandomState_standard_normal_line, sizeof(__pyx_k_RandomState_standard_normal_line), 0, 1, 0, 0},
-  {&__pyx_kp_u_RandomState_standard_t_line_2455, __pyx_k_RandomState_standard_t_line_2455, sizeof(__pyx_k_RandomState_standard_t_line_2455), 0, 1, 0, 0},
+  {&__pyx_kp_u_RandomState_standard_t_line_2460, __pyx_k_RandomState_standard_t_line_2460, sizeof(__pyx_k_RandomState_standard_t_line_2460), 0, 1, 0, 0},
   {&__pyx_kp_u_RandomState_tomaxint_line_863, __pyx_k_RandomState_tomaxint_line_863, sizeof(__pyx_k_RandomState_tomaxint_line_863), 0, 1, 0, 0},
-  {&__pyx_kp_u_RandomState_triangular_line_3602, __pyx_k_RandomState_triangular_line_3602, sizeof(__pyx_k_RandomState_triangular_line_3602), 0, 1, 0, 0},
-  {&__pyx_kp_u_RandomState_uniform_line_1214, __pyx_k_RandomState_uniform_line_1214, sizeof(__pyx_k_RandomState_uniform_line_1214), 0, 1, 0, 0},
-  {&__pyx_kp_u_RandomState_vonmises_line_2561, __pyx_k_RandomState_vonmises_line_2561, sizeof(__pyx_k_RandomState_vonmises_line_2561), 0, 1, 0, 0},
-  {&__pyx_kp_u_RandomState_wald_line_3515, __pyx_k_RandomState_wald_line_3515, sizeof(__pyx_k_RandomState_wald_line_3515), 0, 1, 0, 0},
-  {&__pyx_kp_u_RandomState_weibull_line_2769, __pyx_k_RandomState_weibull_line_2769, sizeof(__pyx_k_RandomState_weibull_line_2769), 0, 1, 0, 0},
-  {&__pyx_kp_u_RandomState_zipf_line_3999, __pyx_k_RandomState_zipf_line_3999, sizeof(__pyx_k_RandomState_zipf_line_3999), 0, 1, 0, 0},
+  {&__pyx_kp_u_RandomState_triangular_line_3609, __pyx_k_RandomState_triangular_line_3609, sizeof(__pyx_k_RandomState_triangular_line_3609), 0, 1, 0, 0},
+  {&__pyx_kp_u_RandomState_uniform_line_1217, __pyx_k_RandomState_uniform_line_1217, sizeof(__pyx_k_RandomState_uniform_line_1217), 0, 1, 0, 0},
+  {&__pyx_kp_u_RandomState_vonmises_line_2566, __pyx_k_RandomState_vonmises_line_2566, sizeof(__pyx_k_RandomState_vonmises_line_2566), 0, 1, 0, 0},
+  {&__pyx_kp_u_RandomState_wald_line_3522, __pyx_k_RandomState_wald_line_3522, sizeof(__pyx_k_RandomState_wald_line_3522), 0, 1, 0, 0},
+  {&__pyx_kp_u_RandomState_weibull_line_2774, __pyx_k_RandomState_weibull_line_2774, sizeof(__pyx_k_RandomState_weibull_line_2774), 0, 1, 0, 0},
+  {&__pyx_kp_u_RandomState_zipf_line_4006, __pyx_k_RandomState_zipf_line_4006, sizeof(__pyx_k_RandomState_zipf_line_4006), 0, 1, 0, 0},
   {&__pyx_kp_s_Range_cannot_be_empty_low_high_u, __pyx_k_Range_cannot_be_empty_low_high_u, sizeof(__pyx_k_Range_cannot_be_empty_low_high_u), 0, 0, 1, 0},
   {&__pyx_kp_s_Range_exceeds_valid_bounds, __pyx_k_Range_exceeds_valid_bounds, sizeof(__pyx_k_Range_exceeds_valid_bounds), 0, 0, 1, 0},
   {&__pyx_n_s_RuntimeWarning, __pyx_k_RuntimeWarning, sizeof(__pyx_k_RuntimeWarning), 0, 0, 1, 1},
@@ -38126,6 +38189,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
   {&__pyx_n_s_power, __pyx_k_power, sizeof(__pyx_k_power), 0, 0, 1, 1},
   {&__pyx_kp_u_power_a_size_None_Draws_samples, __pyx_k_power_a_size_None_Draws_samples, sizeof(__pyx_k_power_a_size_None_Draws_samples), 0, 1, 0, 0},
   {&__pyx_kp_s_probabilities_are_not_non_negati, __pyx_k_probabilities_are_not_non_negati, sizeof(__pyx_k_probabilities_are_not_non_negati), 0, 0, 1, 0},
+  {&__pyx_kp_s_probabilities_contain_NaN, __pyx_k_probabilities_contain_NaN, sizeof(__pyx_k_probabilities_contain_NaN), 0, 0, 1, 0},
   {&__pyx_kp_s_probabilities_do_not_sum_to_1, __pyx_k_probabilities_do_not_sum_to_1, sizeof(__pyx_k_probabilities_do_not_sum_to_1), 0, 0, 1, 0},
   {&__pyx_n_s_prod, __pyx_k_prod, sizeof(__pyx_k_prod), 0, 0, 1, 1},
   {&__pyx_n_s_pvals, __pyx_k_pvals, sizeof(__pyx_k_pvals), 0, 0, 1, 1},
@@ -38241,10 +38305,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
   __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 272, __pyx_L1_error)
   __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 572, __pyx_L1_error)
   __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 976, __pyx_L1_error)
-  __pyx_builtin_OverflowError = __Pyx_GetBuiltinName(__pyx_n_s_OverflowError); if (!__pyx_builtin_OverflowError) __PYX_ERR(0, 1304, __pyx_L1_error)
-  __pyx_builtin_DeprecationWarning = __Pyx_GetBuiltinName(__pyx_n_s_DeprecationWarning); if (!__pyx_builtin_DeprecationWarning) __PYX_ERR(0, 1504, __pyx_L1_error)
-  __pyx_builtin_RuntimeWarning = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeWarning); if (!__pyx_builtin_RuntimeWarning) __PYX_ERR(0, 4531, __pyx_L1_error)
-  __pyx_builtin_reversed = __Pyx_GetBuiltinName(__pyx_n_s_reversed); if (!__pyx_builtin_reversed) __PYX_ERR(0, 4842, __pyx_L1_error)
+  __pyx_builtin_OverflowError = __Pyx_GetBuiltinName(__pyx_n_s_OverflowError); if (!__pyx_builtin_OverflowError) __PYX_ERR(0, 1307, __pyx_L1_error)
+  __pyx_builtin_DeprecationWarning = __Pyx_GetBuiltinName(__pyx_n_s_DeprecationWarning); if (!__pyx_builtin_DeprecationWarning) __PYX_ERR(0, 1507, __pyx_L1_error)
+  __pyx_builtin_RuntimeWarning = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeWarning); if (!__pyx_builtin_RuntimeWarning) __PYX_ERR(0, 4540, __pyx_L1_error)
+  __pyx_builtin_reversed = __Pyx_GetBuiltinName(__pyx_n_s_reversed); if (!__pyx_builtin_reversed) __PYX_ERR(0, 4852, __pyx_L1_error)
   return 0;
   __pyx_L1_error:;
   return -1;
@@ -38883,1311 +38947,1322 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  *                 raise ValueError("'p' must be 1-dimensional")
  *             if p.size != pop_size:
  *                 raise ValueError("'a' and 'p' must have same size")             # <<<<<<<<<<<<<<
- *             if np.logical_or.reduce(p < 0):
- *                 raise ValueError("probabilities are not non-negative")
+ *             p_sum = kahan_sum(pix, d)
+ *             if np.isnan(p_sum):
  */
   __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_a_and_p_must_have_same_size); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 1141, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__20);
   __Pyx_GIVEREF(__pyx_tuple__20);
 
-  /* "mtrand.pyx":1143
- *                 raise ValueError("'a' and 'p' must have same size")
+  /* "mtrand.pyx":1144
+ *             p_sum = kahan_sum(pix, d)
+ *             if np.isnan(p_sum):
+ *                 raise ValueError("probabilities contain NaN")             # <<<<<<<<<<<<<<
  *             if np.logical_or.reduce(p < 0):
- *                 raise ValueError("probabilities are not non-negative")             # <<<<<<<<<<<<<<
- *             if abs(kahan_sum(pix, d) - 1.) > atol:
- *                 raise ValueError("probabilities do not sum to 1")
+ *                 raise ValueError("probabilities are not non-negative")
  */
-  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_probabilities_are_not_non_negati); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 1143, __pyx_L1_error)
+  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_probabilities_contain_NaN); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 1144, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__21);
   __Pyx_GIVEREF(__pyx_tuple__21);
 
-  /* "mtrand.pyx":1145
+  /* "mtrand.pyx":1146
+ *                 raise ValueError("probabilities contain NaN")
+ *             if np.logical_or.reduce(p < 0):
+ *                 raise ValueError("probabilities are not non-negative")             # <<<<<<<<<<<<<<
+ *             if abs(p_sum - 1.) > atol:
+ *                 raise ValueError("probabilities do not sum to 1")
+ */
+  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_probabilities_are_not_non_negati); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 1146, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__22);
+  __Pyx_GIVEREF(__pyx_tuple__22);
+
+  /* "mtrand.pyx":1148
  *                 raise ValueError("probabilities are not non-negative")
- *             if abs(kahan_sum(pix, d) - 1.) > atol:
+ *             if abs(p_sum - 1.) > atol:
  *                 raise ValueError("probabilities do not sum to 1")             # <<<<<<<<<<<<<<
  * 
  *         shape = size
  */
-  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_probabilities_do_not_sum_to_1); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 1145, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__22);
-  __Pyx_GIVEREF(__pyx_tuple__22);
+  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_probabilities_do_not_sum_to_1); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 1148, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__23);
+  __Pyx_GIVEREF(__pyx_tuple__23);
 
-  /* "mtrand.pyx":1165
+  /* "mtrand.pyx":1168
  *         else:
  *             if size > pop_size:
  *                 raise ValueError("Cannot take a larger sample than "             # <<<<<<<<<<<<<<
  *                                  "population when 'replace=False'")
  * 
  */
-  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_Cannot_take_a_larger_sample_than); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 1165, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__23);
-  __Pyx_GIVEREF(__pyx_tuple__23);
+  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_Cannot_take_a_larger_sample_than); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 1168, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__24);
+  __Pyx_GIVEREF(__pyx_tuple__24);
 
-  /* "mtrand.pyx":1170
+  /* "mtrand.pyx":1173
  *             if p is not None:
  *                 if np.count_nonzero(p > 0) < size:
  *                     raise ValueError("Fewer non-zero entries in p than size")             # <<<<<<<<<<<<<<
  *                 n_uniq = 0
  *                 p = p.copy()
  */
-  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_Fewer_non_zero_entries_in_p_than); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 1170, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__24);
-  __Pyx_GIVEREF(__pyx_tuple__24);
+  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_Fewer_non_zero_entries_in_p_than); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 1173, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__25);
+  __Pyx_GIVEREF(__pyx_tuple__25);
 
-  /* "mtrand.pyx":1207
+  /* "mtrand.pyx":1210
  *             # array, taking into account that np.array(item) may not work
  *             # for object arrays.
  *             res = np.empty((), dtype=a.dtype)             # <<<<<<<<<<<<<<
  *             res[()] = a[idx]
  *             return res
  */
-  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_empty_tuple); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 1207, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__25);
-  __Pyx_GIVEREF(__pyx_tuple__25);
+  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_empty_tuple); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 1210, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__26);
+  __Pyx_GIVEREF(__pyx_tuple__26);
 
-  /* "mtrand.pyx":1304
+  /* "mtrand.pyx":1307
  * 
  *             if not npy_isfinite(fscale):
  *                 raise OverflowError('Range exceeds valid bounds')             # <<<<<<<<<<<<<<
  * 
  *             return cont2_array_sc(self.internal_state, rk_uniform, size, flow,
  */
-  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Range_exceeds_valid_bounds); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 1304, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__26);
-  __Pyx_GIVEREF(__pyx_tuple__26);
+  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_Range_exceeds_valid_bounds); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 1307, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__27);
+  __Pyx_GIVEREF(__pyx_tuple__27);
 
-  /* "mtrand.pyx":1315
+  /* "mtrand.pyx":1318
  * 
  *         if not np.all(np.isfinite(odiff)):
  *             raise OverflowError('Range exceeds valid bounds')             # <<<<<<<<<<<<<<
  * 
  *         return cont2_array(self.internal_state, rk_uniform, size, olow, odiff,
  */
-  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Range_exceeds_valid_bounds); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 1315, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__26);
-  __Pyx_GIVEREF(__pyx_tuple__26);
+  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_Range_exceeds_valid_bounds); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 1318, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__27);
+  __Pyx_GIVEREF(__pyx_tuple__27);
 
-  /* "mtrand.pyx":1650
+  /* "mtrand.pyx":1653
  *             fscale = PyFloat_AsDouble(scale)
  *             if np.signbit(fscale):
  *                 raise ValueError("scale < 0")             # <<<<<<<<<<<<<<
  *             return cont2_array_sc(self.internal_state, rk_normal, size, floc,
  *                                   fscale, self.lock)
  */
-  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_scale_0); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 1650, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__27);
-  __Pyx_GIVEREF(__pyx_tuple__27);
+  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_scale_0); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 1653, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__28);
+  __Pyx_GIVEREF(__pyx_tuple__28);
 
-  /* "mtrand.pyx":1655
+  /* "mtrand.pyx":1658
  * 
  *         if np.any(np.signbit(oscale)):
  *             raise ValueError("scale < 0")             # <<<<<<<<<<<<<<
  *         return cont2_array(self.internal_state, rk_normal, size, oloc, oscale,
  *                            self.lock)
  */
-  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_scale_0); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 1655, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__27);
-  __Pyx_GIVEREF(__pyx_tuple__27);
+  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_scale_0); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 1658, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__28);
+  __Pyx_GIVEREF(__pyx_tuple__28);
 
-  /* "mtrand.pyx":1708
+  /* "mtrand.pyx":1711
  * 
  *             if fa <= 0:
  *                 raise ValueError("a <= 0")             # <<<<<<<<<<<<<<
  *             if fb <= 0:
  *                 raise ValueError("b <= 0")
  */
-  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_a_0); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 1708, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__28);
-  __Pyx_GIVEREF(__pyx_tuple__28);
+  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_a_0); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 1711, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__29);
+  __Pyx_GIVEREF(__pyx_tuple__29);
 
-  /* "mtrand.pyx":1710
+  /* "mtrand.pyx":1713
  *                 raise ValueError("a <= 0")
  *             if fb <= 0:
  *                 raise ValueError("b <= 0")             # <<<<<<<<<<<<<<
  *             return cont2_array_sc(self.internal_state, rk_beta, size, fa, fb,
  *                                   self.lock)
  */
-  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_b_0); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 1710, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__29);
-  __Pyx_GIVEREF(__pyx_tuple__29);
+  __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_b_0); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 1713, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__30);
+  __Pyx_GIVEREF(__pyx_tuple__30);
 
-  /* "mtrand.pyx":1715
+  /* "mtrand.pyx":1718
  * 
  *         if np.any(np.less_equal(oa, 0)):
  *             raise ValueError("a <= 0")             # <<<<<<<<<<<<<<
  *         if np.any(np.less_equal(ob, 0)):
  *             raise ValueError("b <= 0")
  */
-  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_a_0); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 1715, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__28);
-  __Pyx_GIVEREF(__pyx_tuple__28);
+  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_a_0); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 1718, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__29);
+  __Pyx_GIVEREF(__pyx_tuple__29);
 
-  /* "mtrand.pyx":1717
+  /* "mtrand.pyx":1720
  *             raise ValueError("a <= 0")
  *         if np.any(np.less_equal(ob, 0)):
  *             raise ValueError("b <= 0")             # <<<<<<<<<<<<<<
  *         return cont2_array(self.internal_state, rk_beta, size, oa, ob,
  *                            self.lock)
  */
-  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_b_0); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 1717, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__29);
-  __Pyx_GIVEREF(__pyx_tuple__29);
+  __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_b_0); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 1720, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__30);
+  __Pyx_GIVEREF(__pyx_tuple__30);
 
-  /* "mtrand.pyx":1774
+  /* "mtrand.pyx":1777
  *             fscale = PyFloat_AsDouble(scale)
  *             if np.signbit(fscale):
  *                 raise ValueError("scale < 0")             # <<<<<<<<<<<<<<
  *             return cont1_array_sc(self.internal_state, rk_exponential, size,
  *                                   fscale, self.lock)
  */
-  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_scale_0); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 1774, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__27);
-  __Pyx_GIVEREF(__pyx_tuple__27);
+  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_scale_0); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 1777, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__28);
+  __Pyx_GIVEREF(__pyx_tuple__28);
 
-  /* "mtrand.pyx":1779
+  /* "mtrand.pyx":1782
  * 
  *         if np.any(np.signbit(oscale)):
  *             raise ValueError("scale < 0")             # <<<<<<<<<<<<<<
  *         return cont1_array(self.internal_state, rk_exponential, size, oscale,
  *                            self.lock)
  */
-  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_scale_0); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 1779, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__27);
-  __Pyx_GIVEREF(__pyx_tuple__27);
+  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_scale_0); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 1782, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__28);
+  __Pyx_GIVEREF(__pyx_tuple__28);
 
-  /* "mtrand.pyx":1891
+  /* "mtrand.pyx":1894
  *             fshape = PyFloat_AsDouble(shape)
  *             if np.signbit(fshape):
  *                 raise ValueError("shape < 0")             # <<<<<<<<<<<<<<
  *             return cont1_array_sc(self.internal_state, rk_standard_gamma,
  *                                   size, fshape, self.lock)
  */
-  __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_shape_0); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 1891, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__30);
-  __Pyx_GIVEREF(__pyx_tuple__30);
+  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_shape_0); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 1894, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__31);
+  __Pyx_GIVEREF(__pyx_tuple__31);
 
-  /* "mtrand.pyx":1896
+  /* "mtrand.pyx":1899
  * 
  *         if np.any(np.signbit(oshape)):
  *             raise ValueError("shape < 0")             # <<<<<<<<<<<<<<
  *         return cont1_array(self.internal_state, rk_standard_gamma, size,
  *                            oshape, self.lock)
  */
-  __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_shape_0); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 1896, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__30);
-  __Pyx_GIVEREF(__pyx_tuple__30);
+  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_shape_0); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 1899, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__31);
+  __Pyx_GIVEREF(__pyx_tuple__31);
 
-  /* "mtrand.pyx":1983
+  /* "mtrand.pyx":1986
  *             fscale = PyFloat_AsDouble(scale)
  *             if np.signbit(fshape):
  *                 raise ValueError("shape < 0")             # <<<<<<<<<<<<<<
  *             if np.signbit(fscale):
  *                 raise ValueError("scale < 0")
  */
-  __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_shape_0); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 1983, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__30);
-  __Pyx_GIVEREF(__pyx_tuple__30);
+  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_shape_0); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 1986, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__31);
+  __Pyx_GIVEREF(__pyx_tuple__31);
 
-  /* "mtrand.pyx":1985
+  /* "mtrand.pyx":1988
  *                 raise ValueError("shape < 0")
  *             if np.signbit(fscale):
  *                 raise ValueError("scale < 0")             # <<<<<<<<<<<<<<
  *             return cont2_array_sc(self.internal_state, rk_gamma, size, fshape,
  *                                   fscale, self.lock)
  */
-  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_scale_0); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 1985, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__27);
-  __Pyx_GIVEREF(__pyx_tuple__27);
+  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_scale_0); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 1988, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__28);
+  __Pyx_GIVEREF(__pyx_tuple__28);
 
-  /* "mtrand.pyx":1990
+  /* "mtrand.pyx":1993
  * 
  *         if np.any(np.signbit(oshape)):
  *             raise ValueError("shape < 0")             # <<<<<<<<<<<<<<
  *         if np.any(np.signbit(oscale)):
  *             raise ValueError("scale < 0")
  */
-  __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_shape_0); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 1990, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__30);
-  __Pyx_GIVEREF(__pyx_tuple__30);
+  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_shape_0); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 1993, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__31);
+  __Pyx_GIVEREF(__pyx_tuple__31);
 
-  /* "mtrand.pyx":1992
+  /* "mtrand.pyx":1995
  *             raise ValueError("shape < 0")
  *         if np.any(np.signbit(oscale)):
  *             raise ValueError("scale < 0")             # <<<<<<<<<<<<<<
  *         return cont2_array(self.internal_state, rk_gamma, size, oshape, oscale,
  *                            self.lock)
  */
-  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_scale_0); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 1992, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__27);
-  __Pyx_GIVEREF(__pyx_tuple__27);
+  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_scale_0); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 1995, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__28);
+  __Pyx_GIVEREF(__pyx_tuple__28);
 
-  /* "mtrand.pyx":2090
+  /* "mtrand.pyx":2093
  * 
  *             if fdfnum <= 0:
  *                 raise ValueError("dfnum <= 0")             # <<<<<<<<<<<<<<
  *             if fdfden <= 0:
  *                 raise ValueError("dfden <= 0")
  */
-  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_dfnum_0); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 2090, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__31);
-  __Pyx_GIVEREF(__pyx_tuple__31);
+  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_dfnum_0); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 2093, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__32);
+  __Pyx_GIVEREF(__pyx_tuple__32);
 
-  /* "mtrand.pyx":2092
+  /* "mtrand.pyx":2095
  *                 raise ValueError("dfnum <= 0")
  *             if fdfden <= 0:
  *                 raise ValueError("dfden <= 0")             # <<<<<<<<<<<<<<
  *             return cont2_array_sc(self.internal_state, rk_f, size, fdfnum,
  *                                   fdfden, self.lock)
  */
-  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_dfden_0); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 2092, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__32);
-  __Pyx_GIVEREF(__pyx_tuple__32);
+  __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_dfden_0); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 2095, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__33);
+  __Pyx_GIVEREF(__pyx_tuple__33);
 
-  /* "mtrand.pyx":2097
+  /* "mtrand.pyx":2100
  * 
  *         if np.any(np.less_equal(odfnum, 0.0)):
  *             raise ValueError("dfnum <= 0")             # <<<<<<<<<<<<<<
  *         if np.any(np.less_equal(odfden, 0.0)):
  *             raise ValueError("dfden <= 0")
  */
-  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_dfnum_0); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 2097, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__31);
-  __Pyx_GIVEREF(__pyx_tuple__31);
+  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_dfnum_0); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 2100, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__32);
+  __Pyx_GIVEREF(__pyx_tuple__32);
 
-  /* "mtrand.pyx":2099
+  /* "mtrand.pyx":2102
  *             raise ValueError("dfnum <= 0")
  *         if np.any(np.less_equal(odfden, 0.0)):
  *             raise ValueError("dfden <= 0")             # <<<<<<<<<<<<<<
  *         return cont2_array(self.internal_state, rk_f, size, odfnum, odfden,
  *                            self.lock)
  */
-  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_dfden_0); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 2099, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__32);
-  __Pyx_GIVEREF(__pyx_tuple__32);
+  __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_dfden_0); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 2102, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__33);
+  __Pyx_GIVEREF(__pyx_tuple__33);
 
-  /* "mtrand.pyx":2187
+  /* "mtrand.pyx":2191
  * 
  *             if fdfnum <= 0:
  *                 raise ValueError("dfnum <= 0")             # <<<<<<<<<<<<<<
  *             if fdfden <= 0:
  *                 raise ValueError("dfden <= 0")
  */
-  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_dfnum_0); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 2187, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__31);
-  __Pyx_GIVEREF(__pyx_tuple__31);
+  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_dfnum_0); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 2191, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__32);
+  __Pyx_GIVEREF(__pyx_tuple__32);
 
-  /* "mtrand.pyx":2189
+  /* "mtrand.pyx":2193
  *                 raise ValueError("dfnum <= 0")
  *             if fdfden <= 0:
  *                 raise ValueError("dfden <= 0")             # <<<<<<<<<<<<<<
  *             if fnonc < 0:
  *                 raise ValueError("nonc < 0")
  */
-  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_dfden_0); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 2189, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__32);
-  __Pyx_GIVEREF(__pyx_tuple__32);
+  __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_dfden_0); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 2193, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__33);
+  __Pyx_GIVEREF(__pyx_tuple__33);
 
-  /* "mtrand.pyx":2191
+  /* "mtrand.pyx":2195
  *                 raise ValueError("dfden <= 0")
  *             if fnonc < 0:
  *                 raise ValueError("nonc < 0")             # <<<<<<<<<<<<<<
  *             return cont3_array_sc(self.internal_state, rk_noncentral_f, size,
  *                                   fdfnum, fdfden, fnonc, self.lock)
  */
-  __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_nonc_0); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 2191, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__33);
-  __Pyx_GIVEREF(__pyx_tuple__33);
+  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_nonc_0); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 2195, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__34);
+  __Pyx_GIVEREF(__pyx_tuple__34);
 
-  /* "mtrand.pyx":2196
+  /* "mtrand.pyx":2200
  * 
  *         if np.any(np.less_equal(odfnum, 0.0)):
  *             raise ValueError("dfnum <= 0")             # <<<<<<<<<<<<<<
  *         if np.any(np.less_equal(odfden, 0.0)):
  *             raise ValueError("dfden <= 0")
  */
-  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_dfnum_0); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 2196, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__31);
-  __Pyx_GIVEREF(__pyx_tuple__31);
+  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_dfnum_0); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 2200, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__32);
+  __Pyx_GIVEREF(__pyx_tuple__32);
 
-  /* "mtrand.pyx":2198
+  /* "mtrand.pyx":2202
  *             raise ValueError("dfnum <= 0")
  *         if np.any(np.less_equal(odfden, 0.0)):
  *             raise ValueError("dfden <= 0")             # <<<<<<<<<<<<<<
  *         if np.any(np.less(ononc, 0.0)):
  *             raise ValueError("nonc < 0")
  */
-  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_dfden_0); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 2198, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__32);
-  __Pyx_GIVEREF(__pyx_tuple__32);
+  __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_dfden_0); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 2202, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__33);
+  __Pyx_GIVEREF(__pyx_tuple__33);
 
-  /* "mtrand.pyx":2200
+  /* "mtrand.pyx":2204
  *             raise ValueError("dfden <= 0")
  *         if np.any(np.less(ononc, 0.0)):
  *             raise ValueError("nonc < 0")             # <<<<<<<<<<<<<<
  *         return cont3_array(self.internal_state, rk_noncentral_f, size, odfnum,
  *                            odfden, ononc, self.lock)
  */
-  __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_nonc_0); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 2200, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__33);
-  __Pyx_GIVEREF(__pyx_tuple__33);
+  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_nonc_0); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 2204, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__34);
+  __Pyx_GIVEREF(__pyx_tuple__34);
 
-  /* "mtrand.pyx":2276
+  /* "mtrand.pyx":2280
  * 
  *             if fdf <= 0:
  *                 raise ValueError("df <= 0")             # <<<<<<<<<<<<<<
  *             return cont1_array_sc(self.internal_state, rk_chisquare, size, fdf,
  *                                   self.lock)
  */
-  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_df_0); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 2276, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__34);
-  __Pyx_GIVEREF(__pyx_tuple__34);
+  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_df_0); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 2280, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__35);
+  __Pyx_GIVEREF(__pyx_tuple__35);
 
-  /* "mtrand.pyx":2281
+  /* "mtrand.pyx":2285
  * 
  *         if np.any(np.less_equal(odf, 0.0)):
  *             raise ValueError("df <= 0")             # <<<<<<<<<<<<<<
  *         return cont1_array(self.internal_state, rk_chisquare, size, odf,
  *                            self.lock)
  */
-  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_df_0); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 2281, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__34);
-  __Pyx_GIVEREF(__pyx_tuple__34);
+  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_df_0); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 2285, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__35);
+  __Pyx_GIVEREF(__pyx_tuple__35);
 
-  /* "mtrand.pyx":2378
+  /* "mtrand.pyx":2382
  * 
  *             if fdf <= 0:
  *                 raise ValueError("df <= 0")             # <<<<<<<<<<<<<<
  *             if fnonc < 0:
  *                 raise ValueError("nonc < 0")
  */
-  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_df_0); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 2378, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__34);
-  __Pyx_GIVEREF(__pyx_tuple__34);
+  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_df_0); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 2382, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__35);
+  __Pyx_GIVEREF(__pyx_tuple__35);
 
-  /* "mtrand.pyx":2380
+  /* "mtrand.pyx":2384
  *                 raise ValueError("df <= 0")
  *             if fnonc < 0:
  *                 raise ValueError("nonc < 0")             # <<<<<<<<<<<<<<
  *             return cont2_array_sc(self.internal_state, rk_noncentral_chisquare,
  *                                   size, fdf, fnonc, self.lock)
  */
-  __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_nonc_0); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 2380, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__33);
-  __Pyx_GIVEREF(__pyx_tuple__33);
+  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_nonc_0); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 2384, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__34);
+  __Pyx_GIVEREF(__pyx_tuple__34);
 
-  /* "mtrand.pyx":2385
+  /* "mtrand.pyx":2389
  * 
  *         if np.any(np.less_equal(odf, 0.0)):
  *             raise ValueError("df <= 0")             # <<<<<<<<<<<<<<
  *         if np.any(np.less(ononc, 0.0)):
  *             raise ValueError("nonc < 0")
  */
-  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_df_0); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 2385, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__34);
-  __Pyx_GIVEREF(__pyx_tuple__34);
+  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_df_0); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 2389, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__35);
+  __Pyx_GIVEREF(__pyx_tuple__35);
 
-  /* "mtrand.pyx":2387
+  /* "mtrand.pyx":2391
  *             raise ValueError("df <= 0")
  *         if np.any(np.less(ononc, 0.0)):
  *             raise ValueError("nonc < 0")             # <<<<<<<<<<<<<<
  *         return cont2_array(self.internal_state, rk_noncentral_chisquare, size,
  *                            odf, ononc, self.lock)
  */
-  __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_nonc_0); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 2387, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__33);
-  __Pyx_GIVEREF(__pyx_tuple__33);
+  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_nonc_0); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 2391, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__34);
+  __Pyx_GIVEREF(__pyx_tuple__34);
 
-  /* "mtrand.pyx":2552
+  /* "mtrand.pyx":2557
  * 
  *             if fdf <= 0:
  *                 raise ValueError("df <= 0")             # <<<<<<<<<<<<<<
  *             return cont1_array_sc(self.internal_state, rk_standard_t, size,
  *                                   fdf, self.lock)
  */
-  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_df_0); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 2552, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__34);
-  __Pyx_GIVEREF(__pyx_tuple__34);
+  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_df_0); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 2557, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__35);
+  __Pyx_GIVEREF(__pyx_tuple__35);
 
-  /* "mtrand.pyx":2557
+  /* "mtrand.pyx":2562
  * 
  *         if np.any(np.less_equal(odf, 0.0)):
  *             raise ValueError("df <= 0")             # <<<<<<<<<<<<<<
  *         return cont1_array(self.internal_state, rk_standard_t, size, odf,
  *                            self.lock)
  */
-  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_df_0); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 2557, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__34);
-  __Pyx_GIVEREF(__pyx_tuple__34);
+  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_df_0); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 2562, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__35);
+  __Pyx_GIVEREF(__pyx_tuple__35);
 
-  /* "mtrand.pyx":2650
+  /* "mtrand.pyx":2655
  * 
  *             if fkappa < 0:
  *                 raise ValueError("kappa < 0")             # <<<<<<<<<<<<<<
  *             return cont2_array_sc(self.internal_state, rk_vonmises, size, fmu,
  *                                   fkappa, self.lock)
  */
-  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_kappa_0); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 2650, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__35);
-  __Pyx_GIVEREF(__pyx_tuple__35);
+  __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_kappa_0); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 2655, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__36);
+  __Pyx_GIVEREF(__pyx_tuple__36);
 
-  /* "mtrand.pyx":2655
+  /* "mtrand.pyx":2660
  * 
  *         if np.any(np.less(okappa, 0.0)):
  *             raise ValueError("kappa < 0")             # <<<<<<<<<<<<<<
  *         return cont2_array(self.internal_state, rk_vonmises, size, omu, okappa,
  *                            self.lock)
  */
-  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_kappa_0); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 2655, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__35);
-  __Pyx_GIVEREF(__pyx_tuple__35);
+  __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_kappa_0); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 2660, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__36);
+  __Pyx_GIVEREF(__pyx_tuple__36);
 
-  /* "mtrand.pyx":2761
+  /* "mtrand.pyx":2766
  * 
  *             if fa <= 0:
  *                 raise ValueError("a <= 0")             # <<<<<<<<<<<<<<
  *             return cont1_array_sc(self.internal_state, rk_pareto, size, fa,
  *                                   self.lock)
  */
-  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_a_0); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 2761, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__28);
-  __Pyx_GIVEREF(__pyx_tuple__28);
+  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_a_0); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 2766, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__29);
+  __Pyx_GIVEREF(__pyx_tuple__29);
 
-  /* "mtrand.pyx":2766
+  /* "mtrand.pyx":2771
  * 
  *         if np.any(np.less_equal(oa, 0.0)):
  *             raise ValueError("a <= 0")             # <<<<<<<<<<<<<<
  *         return cont1_array(self.internal_state, rk_pareto, size, oa, self.lock)
  * 
  */
-  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_a_0); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 2766, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__28);
-  __Pyx_GIVEREF(__pyx_tuple__28);
+  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_a_0); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 2771, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__29);
+  __Pyx_GIVEREF(__pyx_tuple__29);
 
-  /* "mtrand.pyx":2870
+  /* "mtrand.pyx":2875
  *             fa = PyFloat_AsDouble(a)
  *             if np.signbit(fa):
  *                 raise ValueError("a < 0")             # <<<<<<<<<<<<<<
  *             return cont1_array_sc(self.internal_state, rk_weibull, size, fa,
  *                                   self.lock)
  */
-  __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_a_0_2); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 2870, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__36);
-  __Pyx_GIVEREF(__pyx_tuple__36);
+  __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_a_0_2); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 2875, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__37);
+  __Pyx_GIVEREF(__pyx_tuple__37);
 
-  /* "mtrand.pyx":2875
+  /* "mtrand.pyx":2880
  * 
  *         if np.any(np.signbit(oa)):
  *             raise ValueError("a < 0")             # <<<<<<<<<<<<<<
  *         return cont1_array(self.internal_state, rk_weibull, size, oa,
  *                            self.lock)
  */
-  __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_a_0_2); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 2875, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__36);
-  __Pyx_GIVEREF(__pyx_tuple__36);
+  __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_a_0_2); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 2880, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__37);
+  __Pyx_GIVEREF(__pyx_tuple__37);
 
-  /* "mtrand.pyx":2982
+  /* "mtrand.pyx":2987
  *             fa = PyFloat_AsDouble(a)
  *             if np.signbit(fa):
  *                 raise ValueError("a < 0")             # <<<<<<<<<<<<<<
  *             return cont1_array_sc(self.internal_state, rk_power, size, fa,
  *                                   self.lock)
  */
-  __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_a_0_2); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 2982, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__36);
-  __Pyx_GIVEREF(__pyx_tuple__36);
+  __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_a_0_2); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 2987, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__37);
+  __Pyx_GIVEREF(__pyx_tuple__37);
 
-  /* "mtrand.pyx":2987
+  /* "mtrand.pyx":2992
  * 
  *         if np.any(np.signbit(oa)):
  *             raise ValueError("a < 0")             # <<<<<<<<<<<<<<
  *         return cont1_array(self.internal_state, rk_power, size, oa, self.lock)
  * 
  */
-  __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_a_0_2); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 2987, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__36);
-  __Pyx_GIVEREF(__pyx_tuple__36);
+  __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_a_0_2); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 2992, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__37);
+  __Pyx_GIVEREF(__pyx_tuple__37);
 
-  /* "mtrand.pyx":3079
+  /* "mtrand.pyx":3084
  *             fscale = PyFloat_AsDouble(scale)
  *             if np.signbit(fscale):
  *                 raise ValueError("scale < 0")             # <<<<<<<<<<<<<<
  *             return cont2_array_sc(self.internal_state, rk_laplace, size, floc,
  *                                   fscale, self.lock)
  */
-  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_scale_0); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 3079, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__27);
-  __Pyx_GIVEREF(__pyx_tuple__27);
+  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_scale_0); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 3084, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__28);
+  __Pyx_GIVEREF(__pyx_tuple__28);
 
-  /* "mtrand.pyx":3084
+  /* "mtrand.pyx":3089
  * 
  *         if np.any(np.signbit(oscale)):
  *             raise ValueError("scale < 0")             # <<<<<<<<<<<<<<
  *         return cont2_array(self.internal_state, rk_laplace, size, oloc, oscale,
  *                            self.lock)
  */
-  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_scale_0); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 3084, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__27);
-  __Pyx_GIVEREF(__pyx_tuple__27);
+  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_scale_0); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 3089, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__28);
+  __Pyx_GIVEREF(__pyx_tuple__28);
 
-  /* "mtrand.pyx":3210
+  /* "mtrand.pyx":3215
  *             fscale = PyFloat_AsDouble(scale)
  *             if np.signbit(fscale):
  *                 raise ValueError("scale < 0")             # <<<<<<<<<<<<<<
  *             return cont2_array_sc(self.internal_state, rk_gumbel, size, floc,
  *                                   fscale, self.lock)
  */
-  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_scale_0); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 3210, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__27);
-  __Pyx_GIVEREF(__pyx_tuple__27);
+  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_scale_0); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 3215, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__28);
+  __Pyx_GIVEREF(__pyx_tuple__28);
 
-  /* "mtrand.pyx":3215
+  /* "mtrand.pyx":3220
  * 
  *         if np.any(np.signbit(oscale)):
  *             raise ValueError("scale < 0")             # <<<<<<<<<<<<<<
  *         return cont2_array(self.internal_state, rk_gumbel, size, oloc, oscale,
  *                            self.lock)
  */
-  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_scale_0); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 3215, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__27);
-  __Pyx_GIVEREF(__pyx_tuple__27);
+  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_scale_0); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 3220, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__28);
+  __Pyx_GIVEREF(__pyx_tuple__28);
 
-  /* "mtrand.pyx":3303
+  /* "mtrand.pyx":3309
  *             fscale = PyFloat_AsDouble(scale)
  *             if np.signbit(fscale):
  *                 raise ValueError("scale < 0")             # <<<<<<<<<<<<<<
  *             return cont2_array_sc(self.internal_state, rk_logistic, size, floc,
  *                                   fscale, self.lock)
  */
-  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_scale_0); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 3303, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__27);
-  __Pyx_GIVEREF(__pyx_tuple__27);
+  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_scale_0); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 3309, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__28);
+  __Pyx_GIVEREF(__pyx_tuple__28);
 
-  /* "mtrand.pyx":3308
+  /* "mtrand.pyx":3314
  * 
  *         if np.any(np.signbit(oscale)):
  *             raise ValueError("scale < 0")             # <<<<<<<<<<<<<<
  *         return cont2_array(self.internal_state, rk_logistic, size, oloc,
  *                            oscale, self.lock)
  */
-  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_scale_0); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 3308, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__27);
-  __Pyx_GIVEREF(__pyx_tuple__27);
+  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_scale_0); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 3314, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__28);
+  __Pyx_GIVEREF(__pyx_tuple__28);
 
-  /* "mtrand.pyx":3427
+  /* "mtrand.pyx":3433
  *             fsigma = PyFloat_AsDouble(sigma)
  *             if np.signbit(fsigma):
  *                 raise ValueError("sigma < 0")             # <<<<<<<<<<<<<<
  *             return cont2_array_sc(self.internal_state, rk_lognormal, size,
  *                                   fmean, fsigma, self.lock)
  */
-  __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_sigma_0); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 3427, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__37);
-  __Pyx_GIVEREF(__pyx_tuple__37);
+  __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_sigma_0); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 3433, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__38);
+  __Pyx_GIVEREF(__pyx_tuple__38);
 
-  /* "mtrand.pyx":3432
+  /* "mtrand.pyx":3438
  * 
  *         if np.any(np.signbit(osigma)):
  *             raise ValueError("sigma < 0.0")             # <<<<<<<<<<<<<<
  *         return cont2_array(self.internal_state, rk_lognormal, size, omean,
  *                            osigma, self.lock)
  */
-  __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_sigma_0_0); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 3432, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__38);
-  __Pyx_GIVEREF(__pyx_tuple__38);
+  __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_sigma_0_0); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 3438, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__39);
+  __Pyx_GIVEREF(__pyx_tuple__39);
 
-  /* "mtrand.pyx":3506
+  /* "mtrand.pyx":3513
  *             fscale = PyFloat_AsDouble(scale)
  *             if np.signbit(fscale):
  *                 raise ValueError("scale < 0")             # <<<<<<<<<<<<<<
  *             return cont1_array_sc(self.internal_state, rk_rayleigh, size,
  *                                   fscale, self.lock)
  */
-  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_scale_0); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 3506, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__27);
-  __Pyx_GIVEREF(__pyx_tuple__27);
+  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_scale_0); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 3513, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__28);
+  __Pyx_GIVEREF(__pyx_tuple__28);
 
-  /* "mtrand.pyx":3511
+  /* "mtrand.pyx":3518
  * 
  *         if np.any(np.signbit(oscale)):
  *             raise ValueError("scale < 0.0")             # <<<<<<<<<<<<<<
  *         return cont1_array(self.internal_state, rk_rayleigh, size, oscale,
  *                            self.lock)
  */
-  __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_scale_0_0); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 3511, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__39);
-  __Pyx_GIVEREF(__pyx_tuple__39);
+  __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_s_scale_0_0); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 3518, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__40);
+  __Pyx_GIVEREF(__pyx_tuple__40);
 
-  /* "mtrand.pyx":3589
+  /* "mtrand.pyx":3596
  * 
  *             if fmean <= 0:
  *                 raise ValueError("mean <= 0")             # <<<<<<<<<<<<<<
  *             if fscale <= 0:
  *                 raise ValueError("scale <= 0")
  */
-  __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_s_mean_0); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 3589, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__40);
-  __Pyx_GIVEREF(__pyx_tuple__40);
+  __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_mean_0); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 3596, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__41);
+  __Pyx_GIVEREF(__pyx_tuple__41);
 
-  /* "mtrand.pyx":3591
+  /* "mtrand.pyx":3598
  *                 raise ValueError("mean <= 0")
  *             if fscale <= 0:
  *                 raise ValueError("scale <= 0")             # <<<<<<<<<<<<<<
  *             return cont2_array_sc(self.internal_state, rk_wald, size, fmean,
  *                                   fscale, self.lock)
  */
-  __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_scale_0_2); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 3591, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__41);
-  __Pyx_GIVEREF(__pyx_tuple__41);
+  __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_scale_0_2); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 3598, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__42);
+  __Pyx_GIVEREF(__pyx_tuple__42);
 
-  /* "mtrand.pyx":3596
+  /* "mtrand.pyx":3603
  * 
  *         if np.any(np.less_equal(omean,0.0)):
  *             raise ValueError("mean <= 0.0")             # <<<<<<<<<<<<<<
  *         elif np.any(np.less_equal(oscale,0.0)):
  *             raise ValueError("scale <= 0.0")
  */
-  __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_mean_0_0); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 3596, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__42);
-  __Pyx_GIVEREF(__pyx_tuple__42);
+  __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_mean_0_0); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 3603, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__43);
+  __Pyx_GIVEREF(__pyx_tuple__43);
 
-  /* "mtrand.pyx":3598
+  /* "mtrand.pyx":3605
  *             raise ValueError("mean <= 0.0")
  *         elif np.any(np.less_equal(oscale,0.0)):
  *             raise ValueError("scale <= 0.0")             # <<<<<<<<<<<<<<
  *         return cont2_array(self.internal_state, rk_wald, size, omean, oscale,
  *                            self.lock)
  */
-  __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_scale_0_0_2); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 3598, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__43);
-  __Pyx_GIVEREF(__pyx_tuple__43);
+  __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_scale_0_0_2); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 3605, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__44);
+  __Pyx_GIVEREF(__pyx_tuple__44);
 
-  /* "mtrand.pyx":3678
+  /* "mtrand.pyx":3685
  * 
  *             if fleft > fmode:
  *                 raise ValueError("left > mode")             # <<<<<<<<<<<<<<
  *             if fmode > fright:
  *                 raise ValueError("mode > right")
  */
-  __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_left_mode); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 3678, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__44);
-  __Pyx_GIVEREF(__pyx_tuple__44);
+  __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_left_mode); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 3685, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__45);
+  __Pyx_GIVEREF(__pyx_tuple__45);
 
-  /* "mtrand.pyx":3680
+  /* "mtrand.pyx":3687
  *                 raise ValueError("left > mode")
  *             if fmode > fright:
  *                 raise ValueError("mode > right")             # <<<<<<<<<<<<<<
  *             if fleft == fright:
  *                 raise ValueError("left == right")
  */
-  __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_mode_right); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 3680, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__45);
-  __Pyx_GIVEREF(__pyx_tuple__45);
+  __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_mode_right); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 3687, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__46);
+  __Pyx_GIVEREF(__pyx_tuple__46);
 
-  /* "mtrand.pyx":3682
+  /* "mtrand.pyx":3689
  *                 raise ValueError("mode > right")
  *             if fleft == fright:
  *                 raise ValueError("left == right")             # <<<<<<<<<<<<<<
  *             return cont3_array_sc(self.internal_state, rk_triangular, size,
  *                                   fleft, fmode, fright, self.lock)
  */
-  __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_left_right); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 3682, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__46);
-  __Pyx_GIVEREF(__pyx_tuple__46);
+  __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_left_right); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 3689, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__47);
+  __Pyx_GIVEREF(__pyx_tuple__47);
 
-  /* "mtrand.pyx":3687
+  /* "mtrand.pyx":3694
  * 
  *         if np.any(np.greater(oleft, omode)):
  *             raise ValueError("left > mode")             # <<<<<<<<<<<<<<
  *         if np.any(np.greater(omode, oright)):
  *             raise ValueError("mode > right")
  */
-  __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_left_mode); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 3687, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__44);
-  __Pyx_GIVEREF(__pyx_tuple__44);
+  __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_left_mode); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 3694, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__45);
+  __Pyx_GIVEREF(__pyx_tuple__45);
 
-  /* "mtrand.pyx":3689
+  /* "mtrand.pyx":3696
  *             raise ValueError("left > mode")
  *         if np.any(np.greater(omode, oright)):
  *             raise ValueError("mode > right")             # <<<<<<<<<<<<<<
  *         if np.any(np.equal(oleft, oright)):
  *             raise ValueError("left == right")
  */
-  __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_mode_right); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 3689, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__45);
-  __Pyx_GIVEREF(__pyx_tuple__45);
+  __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_mode_right); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 3696, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__46);
+  __Pyx_GIVEREF(__pyx_tuple__46);
 
-  /* "mtrand.pyx":3691
+  /* "mtrand.pyx":3698
  *             raise ValueError("mode > right")
  *         if np.any(np.equal(oleft, oright)):
  *             raise ValueError("left == right")             # <<<<<<<<<<<<<<
  *         return cont3_array(self.internal_state, rk_triangular, size, oleft,
  *                            omode, oright, self.lock)
  */
-  __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_left_right); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 3691, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__46);
-  __Pyx_GIVEREF(__pyx_tuple__46);
+  __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_left_right); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 3698, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__47);
+  __Pyx_GIVEREF(__pyx_tuple__47);
 
-  /* "mtrand.pyx":3793
+  /* "mtrand.pyx":3800
  * 
  *             if ln < 0:
  *                 raise ValueError("n < 0")             # <<<<<<<<<<<<<<
  *             if fp < 0:
  *                 raise ValueError("p < 0")
  */
-  __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_n_0); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 3793, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__47);
-  __Pyx_GIVEREF(__pyx_tuple__47);
+  __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_n_0); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 3800, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__48);
+  __Pyx_GIVEREF(__pyx_tuple__48);
 
-  /* "mtrand.pyx":3795
+  /* "mtrand.pyx":3802
  *                 raise ValueError("n < 0")
  *             if fp < 0:
  *                 raise ValueError("p < 0")             # <<<<<<<<<<<<<<
  *             elif fp > 1:
  *                 raise ValueError("p > 1")
  */
-  __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_p_0); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 3795, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__48);
-  __Pyx_GIVEREF(__pyx_tuple__48);
+  __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_p_0); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 3802, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__49);
+  __Pyx_GIVEREF(__pyx_tuple__49);
 
-  /* "mtrand.pyx":3797
+  /* "mtrand.pyx":3804
  *                 raise ValueError("p < 0")
  *             elif fp > 1:
  *                 raise ValueError("p > 1")             # <<<<<<<<<<<<<<
  *             elif np.isnan(fp):
  *                 raise ValueError("p is nan")
  */
-  __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_p_1); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 3797, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__49);
-  __Pyx_GIVEREF(__pyx_tuple__49);
+  __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_p_1); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 3804, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__50);
+  __Pyx_GIVEREF(__pyx_tuple__50);
 
-  /* "mtrand.pyx":3799
+  /* "mtrand.pyx":3806
  *                 raise ValueError("p > 1")
  *             elif np.isnan(fp):
  *                 raise ValueError("p is nan")             # <<<<<<<<<<<<<<
  *             return discnp_array_sc(self.internal_state, rk_binomial, size, ln,
  *                                    fp, self.lock)
  */
-  __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_p_is_nan); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 3799, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__50);
-  __Pyx_GIVEREF(__pyx_tuple__50);
+  __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_p_is_nan); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 3806, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__51);
+  __Pyx_GIVEREF(__pyx_tuple__51);
 
-  /* "mtrand.pyx":3804
+  /* "mtrand.pyx":3811
  * 
  *         if np.any(np.less(n, 0)):
  *             raise ValueError("n < 0")             # <<<<<<<<<<<<<<
  *         if np.any(np.less(p, 0)):
  *             raise ValueError("p < 0")
  */
-  __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_n_0); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 3804, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__47);
-  __Pyx_GIVEREF(__pyx_tuple__47);
+  __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_n_0); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 3811, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__48);
+  __Pyx_GIVEREF(__pyx_tuple__48);
 
-  /* "mtrand.pyx":3806
+  /* "mtrand.pyx":3813
  *             raise ValueError("n < 0")
  *         if np.any(np.less(p, 0)):
  *             raise ValueError("p < 0")             # <<<<<<<<<<<<<<
  *         if np.any(np.greater(p, 1)):
  *             raise ValueError("p > 1")
  */
-  __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_p_0); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 3806, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__48);
-  __Pyx_GIVEREF(__pyx_tuple__48);
+  __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_p_0); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 3813, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__49);
+  __Pyx_GIVEREF(__pyx_tuple__49);
 
-  /* "mtrand.pyx":3808
+  /* "mtrand.pyx":3815
  *             raise ValueError("p < 0")
  *         if np.any(np.greater(p, 1)):
  *             raise ValueError("p > 1")             # <<<<<<<<<<<<<<
  *         return discnp_array(self.internal_state, rk_binomial, size, on, op,
  *                             self.lock)
  */
-  __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_p_1); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 3808, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__49);
-  __Pyx_GIVEREF(__pyx_tuple__49);
+  __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_p_1); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 3815, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__50);
+  __Pyx_GIVEREF(__pyx_tuple__50);
 
-  /* "mtrand.pyx":3894
+  /* "mtrand.pyx":3901
  * 
  *             if fn <= 0:
  *                 raise ValueError("n <= 0")             # <<<<<<<<<<<<<<
  *             if fp < 0:
  *                 raise ValueError("p < 0")
  */
-  __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_n_0_2); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 3894, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__51);
-  __Pyx_GIVEREF(__pyx_tuple__51);
+  __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_n_0_2); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 3901, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__52);
+  __Pyx_GIVEREF(__pyx_tuple__52);
 
-  /* "mtrand.pyx":3896
+  /* "mtrand.pyx":3903
  *                 raise ValueError("n <= 0")
  *             if fp < 0:
  *                 raise ValueError("p < 0")             # <<<<<<<<<<<<<<
  *             elif fp > 1:
  *                 raise ValueError("p > 1")
  */
-  __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_p_0); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 3896, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__48);
-  __Pyx_GIVEREF(__pyx_tuple__48);
+  __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_p_0); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 3903, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__49);
+  __Pyx_GIVEREF(__pyx_tuple__49);
 
-  /* "mtrand.pyx":3898
+  /* "mtrand.pyx":3905
  *                 raise ValueError("p < 0")
  *             elif fp > 1:
  *                 raise ValueError("p > 1")             # <<<<<<<<<<<<<<
  *             return discdd_array_sc(self.internal_state, rk_negative_binomial,
  *                                    size, fn, fp, self.lock)
  */
-  __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_p_1); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 3898, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__49);
-  __Pyx_GIVEREF(__pyx_tuple__49);
+  __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_p_1); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 3905, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__50);
+  __Pyx_GIVEREF(__pyx_tuple__50);
 
-  /* "mtrand.pyx":3903
+  /* "mtrand.pyx":3910
  * 
  *         if np.any(np.less_equal(n, 0)):
  *             raise ValueError("n <= 0")             # <<<<<<<<<<<<<<
  *         if np.any(np.less(p, 0)):
  *             raise ValueError("p < 0")
  */
-  __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_n_0_2); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 3903, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__51);
-  __Pyx_GIVEREF(__pyx_tuple__51);
+  __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_n_0_2); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 3910, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__52);
+  __Pyx_GIVEREF(__pyx_tuple__52);
 
-  /* "mtrand.pyx":3905
+  /* "mtrand.pyx":3912
  *             raise ValueError("n <= 0")
  *         if np.any(np.less(p, 0)):
  *             raise ValueError("p < 0")             # <<<<<<<<<<<<<<
  *         if np.any(np.greater(p, 1)):
  *             raise ValueError("p > 1")
  */
-  __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_p_0); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 3905, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__48);
-  __Pyx_GIVEREF(__pyx_tuple__48);
+  __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_p_0); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 3912, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__49);
+  __Pyx_GIVEREF(__pyx_tuple__49);
 
-  /* "mtrand.pyx":3907
+  /* "mtrand.pyx":3914
  *             raise ValueError("p < 0")
  *         if np.any(np.greater(p, 1)):
  *             raise ValueError("p > 1")             # <<<<<<<<<<<<<<
  *         return discdd_array(self.internal_state, rk_negative_binomial, size,
  *                             on, op, self.lock)
  */
-  __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_p_1); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 3907, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__49);
-  __Pyx_GIVEREF(__pyx_tuple__49);
+  __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_p_1); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 3914, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__50);
+  __Pyx_GIVEREF(__pyx_tuple__50);
 
-  /* "mtrand.pyx":3986
+  /* "mtrand.pyx":3993
  * 
  *             if lam < 0:
  *                 raise ValueError("lam < 0")             # <<<<<<<<<<<<<<
  *             if lam > self.poisson_lam_max:
  *                 raise ValueError("lam value too large")
  */
-  __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_lam_0); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 3986, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__52);
-  __Pyx_GIVEREF(__pyx_tuple__52);
+  __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_lam_0); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 3993, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__53);
+  __Pyx_GIVEREF(__pyx_tuple__53);
 
-  /* "mtrand.pyx":3988
+  /* "mtrand.pyx":3995
  *                 raise ValueError("lam < 0")
  *             if lam > self.poisson_lam_max:
  *                 raise ValueError("lam value too large")             # <<<<<<<<<<<<<<
  *             return discd_array_sc(self.internal_state, rk_poisson, size, flam,
  *                                   self.lock)
  */
-  __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_lam_value_too_large); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 3988, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__53);
-  __Pyx_GIVEREF(__pyx_tuple__53);
+  __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_lam_value_too_large); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 3995, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__54);
+  __Pyx_GIVEREF(__pyx_tuple__54);
 
-  /* "mtrand.pyx":3993
+  /* "mtrand.pyx":4000
  * 
  *         if np.any(np.less(olam, 0)):
  *             raise ValueError("lam < 0")             # <<<<<<<<<<<<<<
  *         if np.any(np.greater(olam, self.poisson_lam_max)):
  *             raise ValueError("lam value too large.")
  */
-  __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_lam_0); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 3993, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__52);
-  __Pyx_GIVEREF(__pyx_tuple__52);
+  __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_lam_0); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 4000, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__53);
+  __Pyx_GIVEREF(__pyx_tuple__53);
 
-  /* "mtrand.pyx":3995
+  /* "mtrand.pyx":4002
  *             raise ValueError("lam < 0")
  *         if np.any(np.greater(olam, self.poisson_lam_max)):
  *             raise ValueError("lam value too large.")             # <<<<<<<<<<<<<<
  *         return discd_array(self.internal_state, rk_poisson, size, olam,
  *                            self.lock)
  */
-  __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_lam_value_too_large_2); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 3995, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__54);
-  __Pyx_GIVEREF(__pyx_tuple__54);
+  __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_lam_value_too_large_2); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 4002, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__55);
+  __Pyx_GIVEREF(__pyx_tuple__55);
 
-  /* "mtrand.pyx":4083
+  /* "mtrand.pyx":4090
  *             # use logic that ensures NaN is rejected.
  *             if not fa > 1.0:
  *                 raise ValueError("'a' must be a valid float > 1.0")             # <<<<<<<<<<<<<<
  *             return discd_array_sc(self.internal_state, rk_zipf, size, fa,
  *                                   self.lock)
  */
-  __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_a_must_be_a_valid_float_1_0); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 4083, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__55);
-  __Pyx_GIVEREF(__pyx_tuple__55);
+  __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_s_a_must_be_a_valid_float_1_0); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 4090, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__56);
+  __Pyx_GIVEREF(__pyx_tuple__56);
 
-  /* "mtrand.pyx":4089
+  /* "mtrand.pyx":4096
  *         # use logic that ensures NaN is rejected.
  *         if not np.all(np.greater(oa, 1.0)):
  *             raise ValueError("'a' must contain valid floats > 1.0")             # <<<<<<<<<<<<<<
  *         return discd_array(self.internal_state, rk_zipf, size, oa, self.lock)
  * 
  */
-  __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_s_a_must_contain_valid_floats_1_0); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 4089, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__56);
-  __Pyx_GIVEREF(__pyx_tuple__56);
+  __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_s_a_must_contain_valid_floats_1_0); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 4096, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__57);
+  __Pyx_GIVEREF(__pyx_tuple__57);
 
-  /* "mtrand.pyx":4147
+  /* "mtrand.pyx":4154
  * 
  *             if fp <= 0.0:
  *                 raise ValueError("p <= 0.0")             # <<<<<<<<<<<<<<
  *             if fp > 1.0:
  *                 raise ValueError("p > 1.0")
  */
-  __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_s_p_0_0); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 4147, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__57);
-  __Pyx_GIVEREF(__pyx_tuple__57);
+  __pyx_tuple__58 = PyTuple_Pack(1, __pyx_kp_s_p_0_0); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 4154, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__58);
+  __Pyx_GIVEREF(__pyx_tuple__58);
 
-  /* "mtrand.pyx":4149
+  /* "mtrand.pyx":4156
  *                 raise ValueError("p <= 0.0")
  *             if fp > 1.0:
  *                 raise ValueError("p > 1.0")             # <<<<<<<<<<<<<<
  *             return discd_array_sc(self.internal_state, rk_geometric, size, fp,
  *                                   self.lock)
  */
-  __pyx_tuple__58 = PyTuple_Pack(1, __pyx_kp_s_p_1_0); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 4149, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__58);
-  __Pyx_GIVEREF(__pyx_tuple__58);
+  __pyx_tuple__59 = PyTuple_Pack(1, __pyx_kp_s_p_1_0); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 4156, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__59);
+  __Pyx_GIVEREF(__pyx_tuple__59);
 
-  /* "mtrand.pyx":4154
+  /* "mtrand.pyx":4161
  * 
  *         if np.any(np.less_equal(op, 0.0)):
  *             raise ValueError("p <= 0.0")             # <<<<<<<<<<<<<<
  *         if np.any(np.greater(op, 1.0)):
  *             raise ValueError("p > 1.0")
  */
-  __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_s_p_0_0); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 4154, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__57);
-  __Pyx_GIVEREF(__pyx_tuple__57);
+  __pyx_tuple__58 = PyTuple_Pack(1, __pyx_kp_s_p_0_0); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 4161, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__58);
+  __Pyx_GIVEREF(__pyx_tuple__58);
 
-  /* "mtrand.pyx":4156
+  /* "mtrand.pyx":4163
  *             raise ValueError("p <= 0.0")
  *         if np.any(np.greater(op, 1.0)):
  *             raise ValueError("p > 1.0")             # <<<<<<<<<<<<<<
  *         return discd_array(self.internal_state, rk_geometric, size, op,
  *                            self.lock)
  */
-  __pyx_tuple__58 = PyTuple_Pack(1, __pyx_kp_s_p_1_0); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 4156, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__58);
-  __Pyx_GIVEREF(__pyx_tuple__58);
+  __pyx_tuple__59 = PyTuple_Pack(1, __pyx_kp_s_p_1_0); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 4163, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__59);
+  __Pyx_GIVEREF(__pyx_tuple__59);
 
-  /* "mtrand.pyx":4261
+  /* "mtrand.pyx":4269
  * 
  *             if lngood < 0:
  *                 raise ValueError("ngood < 0")             # <<<<<<<<<<<<<<
  *             if lnbad < 0:
  *                 raise ValueError("nbad < 0")
  */
-  __pyx_tuple__59 = PyTuple_Pack(1, __pyx_kp_s_ngood_0); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 4261, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__59);
-  __Pyx_GIVEREF(__pyx_tuple__59);
+  __pyx_tuple__60 = PyTuple_Pack(1, __pyx_kp_s_ngood_0); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 4269, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__60);
+  __Pyx_GIVEREF(__pyx_tuple__60);
 
-  /* "mtrand.pyx":4263
+  /* "mtrand.pyx":4271
  *                 raise ValueError("ngood < 0")
  *             if lnbad < 0:
  *                 raise ValueError("nbad < 0")             # <<<<<<<<<<<<<<
  *             if lnsample < 1:
  *                 raise ValueError("nsample < 1")
  */
-  __pyx_tuple__60 = PyTuple_Pack(1, __pyx_kp_s_nbad_0); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 4263, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__60);
-  __Pyx_GIVEREF(__pyx_tuple__60);
+  __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_s_nbad_0); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 4271, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__61);
+  __Pyx_GIVEREF(__pyx_tuple__61);
 
-  /* "mtrand.pyx":4265
+  /* "mtrand.pyx":4273
  *                 raise ValueError("nbad < 0")
  *             if lnsample < 1:
  *                 raise ValueError("nsample < 1")             # <<<<<<<<<<<<<<
  *             if lngood + lnbad < lnsample:
  *                 raise ValueError("ngood + nbad < nsample")
  */
-  __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_s_nsample_1); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 4265, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__61);
-  __Pyx_GIVEREF(__pyx_tuple__61);
+  __pyx_tuple__62 = PyTuple_Pack(1, __pyx_kp_s_nsample_1); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 4273, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__62);
+  __Pyx_GIVEREF(__pyx_tuple__62);
 
-  /* "mtrand.pyx":4267
+  /* "mtrand.pyx":4275
  *                 raise ValueError("nsample < 1")
  *             if lngood + lnbad < lnsample:
  *                 raise ValueError("ngood + nbad < nsample")             # <<<<<<<<<<<<<<
  *             return discnmN_array_sc(self.internal_state, rk_hypergeometric,
  *                                     size, lngood, lnbad, lnsample, self.lock)
  */
-  __pyx_tuple__62 = PyTuple_Pack(1, __pyx_kp_s_ngood_nbad_nsample); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 4267, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__62);
-  __Pyx_GIVEREF(__pyx_tuple__62);
+  __pyx_tuple__63 = PyTuple_Pack(1, __pyx_kp_s_ngood_nbad_nsample); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 4275, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__63);
+  __Pyx_GIVEREF(__pyx_tuple__63);
 
-  /* "mtrand.pyx":4272
+  /* "mtrand.pyx":4280
  * 
  *         if np.any(np.less(ongood, 0)):
  *             raise ValueError("ngood < 0")             # <<<<<<<<<<<<<<
  *         if np.any(np.less(onbad, 0)):
  *             raise ValueError("nbad < 0")
  */
-  __pyx_tuple__59 = PyTuple_Pack(1, __pyx_kp_s_ngood_0); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 4272, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__59);
-  __Pyx_GIVEREF(__pyx_tuple__59);
+  __pyx_tuple__60 = PyTuple_Pack(1, __pyx_kp_s_ngood_0); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 4280, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__60);
+  __Pyx_GIVEREF(__pyx_tuple__60);
 
-  /* "mtrand.pyx":4274
+  /* "mtrand.pyx":4282
  *             raise ValueError("ngood < 0")
  *         if np.any(np.less(onbad, 0)):
  *             raise ValueError("nbad < 0")             # <<<<<<<<<<<<<<
  *         if np.any(np.less(onsample, 1)):
  *             raise ValueError("nsample < 1")
  */
-  __pyx_tuple__60 = PyTuple_Pack(1, __pyx_kp_s_nbad_0); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 4274, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__60);
-  __Pyx_GIVEREF(__pyx_tuple__60);
+  __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_s_nbad_0); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 4282, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__61);
+  __Pyx_GIVEREF(__pyx_tuple__61);
 
-  /* "mtrand.pyx":4276
+  /* "mtrand.pyx":4284
  *             raise ValueError("nbad < 0")
  *         if np.any(np.less(onsample, 1)):
  *             raise ValueError("nsample < 1")             # <<<<<<<<<<<<<<
  *         if np.any(np.less(np.add(ongood, onbad),onsample)):
  *             raise ValueError("ngood + nbad < nsample")
  */
-  __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_s_nsample_1); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 4276, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__61);
-  __Pyx_GIVEREF(__pyx_tuple__61);
+  __pyx_tuple__62 = PyTuple_Pack(1, __pyx_kp_s_nsample_1); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 4284, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__62);
+  __Pyx_GIVEREF(__pyx_tuple__62);
 
-  /* "mtrand.pyx":4278
+  /* "mtrand.pyx":4286
  *             raise ValueError("nsample < 1")
  *         if np.any(np.less(np.add(ongood, onbad),onsample)):
  *             raise ValueError("ngood + nbad < nsample")             # <<<<<<<<<<<<<<
  *         return discnmN_array(self.internal_state, rk_hypergeometric, size,
  *                              ongood, onbad, onsample, self.lock)
  */
-  __pyx_tuple__62 = PyTuple_Pack(1, __pyx_kp_s_ngood_nbad_nsample); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 4278, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__62);
-  __Pyx_GIVEREF(__pyx_tuple__62);
+  __pyx_tuple__63 = PyTuple_Pack(1, __pyx_kp_s_ngood_nbad_nsample); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 4286, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__63);
+  __Pyx_GIVEREF(__pyx_tuple__63);
 
-  /* "mtrand.pyx":4365
+  /* "mtrand.pyx":4374
  * 
  *             if fp <= 0.0:
  *                 raise ValueError("p <= 0.0")             # <<<<<<<<<<<<<<
  *             if fp >= 1.0:
  *                 raise ValueError("p >= 1.0")
  */
-  __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_s_p_0_0); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 4365, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__57);
-  __Pyx_GIVEREF(__pyx_tuple__57);
+  __pyx_tuple__58 = PyTuple_Pack(1, __pyx_kp_s_p_0_0); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 4374, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__58);
+  __Pyx_GIVEREF(__pyx_tuple__58);
 
-  /* "mtrand.pyx":4367
+  /* "mtrand.pyx":4376
  *                 raise ValueError("p <= 0.0")
  *             if fp >= 1.0:
  *                 raise ValueError("p >= 1.0")             # <<<<<<<<<<<<<<
  *             return discd_array_sc(self.internal_state, rk_logseries, size, fp,
  *                                   self.lock)
  */
-  __pyx_tuple__63 = PyTuple_Pack(1, __pyx_kp_s_p_1_0_2); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 4367, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__63);
-  __Pyx_GIVEREF(__pyx_tuple__63);
+  __pyx_tuple__64 = PyTuple_Pack(1, __pyx_kp_s_p_1_0_2); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 4376, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__64);
+  __Pyx_GIVEREF(__pyx_tuple__64);
 
-  /* "mtrand.pyx":4372
+  /* "mtrand.pyx":4381
  * 
  *         if np.any(np.less_equal(op, 0.0)):
  *             raise ValueError("p <= 0.0")             # <<<<<<<<<<<<<<
  *         if np.any(np.greater_equal(op, 1.0)):
  *             raise ValueError("p >= 1.0")
  */
-  __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_s_p_0_0); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 4372, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__57);
-  __Pyx_GIVEREF(__pyx_tuple__57);
+  __pyx_tuple__58 = PyTuple_Pack(1, __pyx_kp_s_p_0_0); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 4381, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__58);
+  __Pyx_GIVEREF(__pyx_tuple__58);
 
-  /* "mtrand.pyx":4374
+  /* "mtrand.pyx":4383
  *             raise ValueError("p <= 0.0")
  *         if np.any(np.greater_equal(op, 1.0)):
  *             raise ValueError("p >= 1.0")             # <<<<<<<<<<<<<<
  *         return discd_array(self.internal_state, rk_logseries, size, op,
  *                            self.lock)
  */
-  __pyx_tuple__63 = PyTuple_Pack(1, __pyx_kp_s_p_1_0_2); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 4374, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__63);
-  __Pyx_GIVEREF(__pyx_tuple__63);
+  __pyx_tuple__64 = PyTuple_Pack(1, __pyx_kp_s_p_1_0_2); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 4383, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__64);
+  __Pyx_GIVEREF(__pyx_tuple__64);
 
-  /* "mtrand.pyx":4493
+  /* "mtrand.pyx":4502
  * 
  *         if len(mean.shape) != 1:
  *             raise ValueError("mean must be 1 dimensional")             # <<<<<<<<<<<<<<
  *         if (len(cov.shape) != 2) or (cov.shape[0] != cov.shape[1]):
  *             raise ValueError("cov must be 2 dimensional and square")
  */
-  __pyx_tuple__64 = PyTuple_Pack(1, __pyx_kp_s_mean_must_be_1_dimensional); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 4493, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__64);
-  __Pyx_GIVEREF(__pyx_tuple__64);
+  __pyx_tuple__65 = PyTuple_Pack(1, __pyx_kp_s_mean_must_be_1_dimensional); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 4502, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__65);
+  __Pyx_GIVEREF(__pyx_tuple__65);
 
-  /* "mtrand.pyx":4495
+  /* "mtrand.pyx":4504
  *             raise ValueError("mean must be 1 dimensional")
  *         if (len(cov.shape) != 2) or (cov.shape[0] != cov.shape[1]):
  *             raise ValueError("cov must be 2 dimensional and square")             # <<<<<<<<<<<<<<
  *         if mean.shape[0] != cov.shape[0]:
  *             raise ValueError("mean and cov must have same length")
  */
-  __pyx_tuple__65 = PyTuple_Pack(1, __pyx_kp_s_cov_must_be_2_dimensional_and_sq); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 4495, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__65);
-  __Pyx_GIVEREF(__pyx_tuple__65);
+  __pyx_tuple__66 = PyTuple_Pack(1, __pyx_kp_s_cov_must_be_2_dimensional_and_sq); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 4504, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__66);
+  __Pyx_GIVEREF(__pyx_tuple__66);
 
-  /* "mtrand.pyx":4497
+  /* "mtrand.pyx":4506
  *             raise ValueError("cov must be 2 dimensional and square")
  *         if mean.shape[0] != cov.shape[0]:
  *             raise ValueError("mean and cov must have same length")             # <<<<<<<<<<<<<<
  * 
  *         # Compute shape of output and create a matrix of independent
  */
-  __pyx_tuple__66 = PyTuple_Pack(1, __pyx_kp_s_mean_and_cov_must_have_same_leng); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 4497, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__66);
-  __Pyx_GIVEREF(__pyx_tuple__66);
+  __pyx_tuple__67 = PyTuple_Pack(1, __pyx_kp_s_mean_and_cov_must_have_same_leng); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 4506, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__67);
+  __Pyx_GIVEREF(__pyx_tuple__67);
 
-  /* "mtrand.pyx":4503
+  /* "mtrand.pyx":4512
  *         # with the same length as mean and as many rows are necessary to
  *         # form a matrix of shape final_shape.
  *         final_shape = list(shape[:])             # <<<<<<<<<<<<<<
  *         final_shape.append(mean.shape[0])
  *         x = self.standard_normal(final_shape).reshape(-1, mean.shape[0])
  */
-  __pyx_slice__67 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__67)) __PYX_ERR(0, 4503, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_slice__67);
-  __Pyx_GIVEREF(__pyx_slice__67);
+  __pyx_slice__68 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__68)) __PYX_ERR(0, 4512, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_slice__68);
+  __Pyx_GIVEREF(__pyx_slice__68);
 
-  /* "mtrand.pyx":4524
+  /* "mtrand.pyx":4533
  *         if check_valid != 'ignore':
  *             if check_valid != 'warn' and check_valid != 'raise':
  *                 raise ValueError("check_valid must equal 'warn', 'raise', or 'ignore'")             # <<<<<<<<<<<<<<
  * 
  *             psd = np.allclose(np.dot(v.T * s, v), cov, rtol=tol, atol=tol)
  */
-  __pyx_tuple__68 = PyTuple_Pack(1, __pyx_kp_s_check_valid_must_equal_warn_rais); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 4524, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__68);
-  __Pyx_GIVEREF(__pyx_tuple__68);
+  __pyx_tuple__69 = PyTuple_Pack(1, __pyx_kp_s_check_valid_must_equal_warn_rais); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 4533, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__69);
+  __Pyx_GIVEREF(__pyx_tuple__69);
 
-  /* "mtrand.pyx":4529
+  /* "mtrand.pyx":4538
  *             if not psd:
  *                 if check_valid == 'warn':
  *                     warnings.warn(             # <<<<<<<<<<<<<<
  *                         "covariance is not symmetric positive-semidefinite.",
  *                         RuntimeWarning)
  */
-  __pyx_tuple__69 = PyTuple_Pack(2, __pyx_kp_s_covariance_is_not_symmetric_posi, __pyx_builtin_RuntimeWarning); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 4529, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__69);
-  __Pyx_GIVEREF(__pyx_tuple__69);
+  __pyx_tuple__70 = PyTuple_Pack(2, __pyx_kp_s_covariance_is_not_symmetric_posi, __pyx_builtin_RuntimeWarning); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 4538, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__70);
+  __Pyx_GIVEREF(__pyx_tuple__70);
 
-  /* "mtrand.pyx":4533
+  /* "mtrand.pyx":4542
  *                         RuntimeWarning)
  *                 else:
  *                     raise ValueError(             # <<<<<<<<<<<<<<
  *                         "covariance is not symmetric positive-semidefinite.")
  * 
  */
-  __pyx_tuple__70 = PyTuple_Pack(1, __pyx_kp_s_covariance_is_not_symmetric_posi); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 4533, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__70);
-  __Pyx_GIVEREF(__pyx_tuple__70);
+  __pyx_tuple__71 = PyTuple_Pack(1, __pyx_kp_s_covariance_is_not_symmetric_posi); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 4542, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__71);
+  __Pyx_GIVEREF(__pyx_tuple__71);
 
-  /* "mtrand.pyx":4536
+  /* "mtrand.pyx":4545
  *                         "covariance is not symmetric positive-semidefinite.")
  * 
  *         x = np.dot(x, np.sqrt(s)[:, None] * v)             # <<<<<<<<<<<<<<
  *         x += mean
  *         x.shape = tuple(final_shape)
  */
-  __pyx_slice__67 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__67)) __PYX_ERR(0, 4536, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_slice__67);
-  __Pyx_GIVEREF(__pyx_slice__67);
-  __pyx_tuple__71 = PyTuple_Pack(2, __pyx_slice__67, Py_None); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 4536, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__71);
-  __Pyx_GIVEREF(__pyx_tuple__71);
+  __pyx_slice__68 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__68)) __PYX_ERR(0, 4545, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_slice__68);
+  __Pyx_GIVEREF(__pyx_slice__68);
+  __pyx_tuple__72 = PyTuple_Pack(2, __pyx_slice__68, Py_None); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 4545, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__72);
+  __Pyx_GIVEREF(__pyx_tuple__72);
 
-  /* "mtrand.pyx":4628
+  /* "mtrand.pyx":4637
  * 
  *         if kahan_sum(pix, d-1) > (1.0 + 1e-12):
  *             raise ValueError("sum(pvals[:-1]) > 1.0")             # <<<<<<<<<<<<<<
  * 
  *         shape = _shape_from_size(size, d)
  */
-  __pyx_tuple__72 = PyTuple_Pack(1, __pyx_kp_s_sum_pvals_1_1_0); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 4628, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__72);
-  __Pyx_GIVEREF(__pyx_tuple__72);
+  __pyx_tuple__73 = PyTuple_Pack(1, __pyx_kp_s_sum_pvals_1_1_0); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 4637, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__73);
+  __Pyx_GIVEREF(__pyx_tuple__73);
 
-  /* "mtrand.pyx":4636
+  /* "mtrand.pyx":4645
  *         mnix = <long*>PyArray_DATA(mnarr)
  *         sz = PyArray_SIZE(mnarr)
  *         with self.lock, nogil, cython.cdivision(True):             # <<<<<<<<<<<<<<
  *             i = 0
  *             while i < sz:
  */
-  __pyx_tuple__2 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 4636, __pyx_L1_error)
+  __pyx_tuple__2 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 4645, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__2);
   __Pyx_GIVEREF(__pyx_tuple__2);
 
-  /* "mtrand.pyx":4751
+  /* "mtrand.pyx":4761
  *         alpha_arr   = <ndarray>PyArray_ContiguousFromObject(alpha, NPY_DOUBLE, 1, 1)
  *         if np.any(np.less_equal(alpha_arr, 0)):
  *             raise ValueError('alpha <= 0')             # <<<<<<<<<<<<<<
  *         alpha_data  = <double*>PyArray_DATA(alpha_arr)
  * 
  */
-  __pyx_tuple__73 = PyTuple_Pack(1, __pyx_kp_s_alpha_0); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 4751, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__73);
-  __Pyx_GIVEREF(__pyx_tuple__73);
+  __pyx_tuple__74 = PyTuple_Pack(1, __pyx_kp_s_alpha_0); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 4761, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__74);
+  __Pyx_GIVEREF(__pyx_tuple__74);
 
-  /* "mtrand.pyx":4762
+  /* "mtrand.pyx":4772
  *         i = 0
  *         totsize = PyArray_SIZE(val_arr)
  *         with self.lock, nogil:             # <<<<<<<<<<<<<<
  *             while i < totsize:
  *                 acc = 0.0
  */
-  __pyx_tuple__2 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 4762, __pyx_L1_error)
+  __pyx_tuple__2 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 4772, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__2);
   __Pyx_GIVEREF(__pyx_tuple__2);
 
-  /* "mtrand.pyx":4831
+  /* "mtrand.pyx":4841
  *             buf = np.empty(itemsize, dtype=np.int8) # GC'd at function exit
  *             buf_ptr = <char*><size_t>buf.ctypes.data
  *             with self.lock:             # <<<<<<<<<<<<<<
  *                 # We trick gcc into providing a specialized implementation for
  *                 # the most common case, yielding a ~33% performance improvement.
  */
-  __pyx_tuple__2 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 4831, __pyx_L1_error)
+  __pyx_tuple__2 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 4841, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__2);
   __Pyx_GIVEREF(__pyx_tuple__2);
 
-  /* "mtrand.pyx":4840
+  /* "mtrand.pyx":4850
  *                     self._shuffle_raw(n, itemsize, stride, x_ptr, buf_ptr)
  *         elif isinstance(x, np.ndarray) and x.ndim and x.size:
  *             buf = np.empty_like(x[0,...])             # <<<<<<<<<<<<<<
  *             with self.lock:
  *                 for i in reversed(range(1, n)):
  */
-  __pyx_tuple__74 = PyTuple_Pack(2, __pyx_int_0, Py_Ellipsis); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 4840, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__74);
-  __Pyx_GIVEREF(__pyx_tuple__74);
+  __pyx_tuple__75 = PyTuple_Pack(2, __pyx_int_0, Py_Ellipsis); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 4850, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__75);
+  __Pyx_GIVEREF(__pyx_tuple__75);
 
-  /* "mtrand.pyx":4841
+  /* "mtrand.pyx":4851
  *         elif isinstance(x, np.ndarray) and x.ndim and x.size:
  *             buf = np.empty_like(x[0,...])
  *             with self.lock:             # <<<<<<<<<<<<<<
  *                 for i in reversed(range(1, n)):
  *                     j = rk_interval(i, self.internal_state)
  */
-  __pyx_tuple__2 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 4841, __pyx_L1_error)
+  __pyx_tuple__2 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 4851, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__2);
   __Pyx_GIVEREF(__pyx_tuple__2);
 
-  /* "mtrand.pyx":4849
+  /* "mtrand.pyx":4859
  *         else:
  *             # Untyped path.
  *             with self.lock:             # <<<<<<<<<<<<<<
  *                 for i in reversed(range(1, n)):
  *                     j = rk_interval(i, self.internal_state)
  */
-  __pyx_tuple__2 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 4849, __pyx_L1_error)
+  __pyx_tuple__2 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 4859, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__2);
   __Pyx_GIVEREF(__pyx_tuple__2);
 
@@ -40198,10 +40273,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  *     """
  *     _rand_bool(low, high, size, rngstate)
  */
-  __pyx_tuple__75 = PyTuple_Pack(12, __pyx_n_s_low, __pyx_n_s_high, __pyx_n_s_size, __pyx_n_s_rngstate, __pyx_n_s_off, __pyx_n_s_rng, __pyx_n_s_buf, __pyx_n_s_out, __pyx_n_s_array, __pyx_n_s_cnt, __pyx_n_s_state, __pyx_n_s_array_data); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(2, 5, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__75);
-  __Pyx_GIVEREF(__pyx_tuple__75);
-  __pyx_codeobj__76 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_randint_helpers_pxi, __pyx_n_s_rand_bool, 5, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__76)) __PYX_ERR(2, 5, __pyx_L1_error)
+  __pyx_tuple__76 = PyTuple_Pack(12, __pyx_n_s_low, __pyx_n_s_high, __pyx_n_s_size, __pyx_n_s_rngstate, __pyx_n_s_off, __pyx_n_s_rng, __pyx_n_s_buf, __pyx_n_s_out, __pyx_n_s_array, __pyx_n_s_cnt, __pyx_n_s_state, __pyx_n_s_array_data); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(2, 5, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__76);
+  __Pyx_GIVEREF(__pyx_tuple__76);
+  __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_randint_helpers_pxi, __pyx_n_s_rand_bool, 5, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) __PYX_ERR(2, 5, __pyx_L1_error)
 
   /* "randint_helpers.pxi":56
  *         return array
@@ -40210,10 +40285,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  *     """
  *     _rand_int8(low, high, size, rngstate)
  */
-  __pyx_tuple__77 = PyTuple_Pack(12, __pyx_n_s_low, __pyx_n_s_high, __pyx_n_s_size, __pyx_n_s_rngstate, __pyx_n_s_off, __pyx_n_s_rng, __pyx_n_s_buf, __pyx_n_s_out, __pyx_n_s_array, __pyx_n_s_cnt, __pyx_n_s_state, __pyx_n_s_array_data); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(2, 56, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__77);
-  __Pyx_GIVEREF(__pyx_tuple__77);
-  __pyx_codeobj__78 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__77, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_randint_helpers_pxi, __pyx_n_s_rand_int8, 56, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__78)) __PYX_ERR(2, 56, __pyx_L1_error)
+  __pyx_tuple__78 = PyTuple_Pack(12, __pyx_n_s_low, __pyx_n_s_high, __pyx_n_s_size, __pyx_n_s_rngstate, __pyx_n_s_off, __pyx_n_s_rng, __pyx_n_s_buf, __pyx_n_s_out, __pyx_n_s_array, __pyx_n_s_cnt, __pyx_n_s_state, __pyx_n_s_array_data); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(2, 56, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__78);
+  __Pyx_GIVEREF(__pyx_tuple__78);
+  __pyx_codeobj__79 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__78, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_randint_helpers_pxi, __pyx_n_s_rand_int8, 56, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__79)) __PYX_ERR(2, 56, __pyx_L1_error)
 
   /* "randint_helpers.pxi":107
  *         return array
@@ -40222,10 +40297,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  *     """
  *     _rand_int16(low, high, size, rngstate)
  */
-  __pyx_tuple__79 = PyTuple_Pack(12, __pyx_n_s_low, __pyx_n_s_high, __pyx_n_s_size, __pyx_n_s_rngstate, __pyx_n_s_off, __pyx_n_s_rng, __pyx_n_s_buf, __pyx_n_s_out, __pyx_n_s_array, __pyx_n_s_cnt, __pyx_n_s_state, __pyx_n_s_array_data); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(2, 107, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__79);
-  __Pyx_GIVEREF(__pyx_tuple__79);
-  __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_randint_helpers_pxi, __pyx_n_s_rand_int16, 107, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) __PYX_ERR(2, 107, __pyx_L1_error)
+  __pyx_tuple__80 = PyTuple_Pack(12, __pyx_n_s_low, __pyx_n_s_high, __pyx_n_s_size, __pyx_n_s_rngstate, __pyx_n_s_off, __pyx_n_s_rng, __pyx_n_s_buf, __pyx_n_s_out, __pyx_n_s_array, __pyx_n_s_cnt, __pyx_n_s_state, __pyx_n_s_array_data); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(2, 107, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__80);
+  __Pyx_GIVEREF(__pyx_tuple__80);
+  __pyx_codeobj__81 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__80, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_randint_helpers_pxi, __pyx_n_s_rand_int16, 107, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__81)) __PYX_ERR(2, 107, __pyx_L1_error)
 
   /* "randint_helpers.pxi":158
  *         return array
@@ -40234,10 +40309,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  *     """
  *     _rand_int32(low, high, size, rngstate)
  */
-  __pyx_tuple__81 = PyTuple_Pack(12, __pyx_n_s_low, __pyx_n_s_high, __pyx_n_s_size, __pyx_n_s_rngstate, __pyx_n_s_off, __pyx_n_s_rng, __pyx_n_s_buf, __pyx_n_s_out, __pyx_n_s_array, __pyx_n_s_cnt, __pyx_n_s_state, __pyx_n_s_array_data); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(2, 158, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__81);
-  __Pyx_GIVEREF(__pyx_tuple__81);
-  __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__81, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_randint_helpers_pxi, __pyx_n_s_rand_int32, 158, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) __PYX_ERR(2, 158, __pyx_L1_error)
+  __pyx_tuple__82 = PyTuple_Pack(12, __pyx_n_s_low, __pyx_n_s_high, __pyx_n_s_size, __pyx_n_s_rngstate, __pyx_n_s_off, __pyx_n_s_rng, __pyx_n_s_buf, __pyx_n_s_out, __pyx_n_s_array, __pyx_n_s_cnt, __pyx_n_s_state, __pyx_n_s_array_data); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(2, 158, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__82);
+  __Pyx_GIVEREF(__pyx_tuple__82);
+  __pyx_codeobj__83 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_randint_helpers_pxi, __pyx_n_s_rand_int32, 158, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__83)) __PYX_ERR(2, 158, __pyx_L1_error)
 
   /* "randint_helpers.pxi":209
  *         return array
@@ -40246,10 +40321,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  *     """
  *     _rand_int64(low, high, size, rngstate)
  */
-  __pyx_tuple__83 = PyTuple_Pack(12, __pyx_n_s_low, __pyx_n_s_high, __pyx_n_s_size, __pyx_n_s_rngstate, __pyx_n_s_off, __pyx_n_s_rng, __pyx_n_s_buf, __pyx_n_s_out, __pyx_n_s_array, __pyx_n_s_cnt, __pyx_n_s_state, __pyx_n_s_array_data); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(2, 209, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__83);
-  __Pyx_GIVEREF(__pyx_tuple__83);
-  __pyx_codeobj__84 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__83, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_randint_helpers_pxi, __pyx_n_s_rand_int64, 209, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__84)) __PYX_ERR(2, 209, __pyx_L1_error)
+  __pyx_tuple__84 = PyTuple_Pack(12, __pyx_n_s_low, __pyx_n_s_high, __pyx_n_s_size, __pyx_n_s_rngstate, __pyx_n_s_off, __pyx_n_s_rng, __pyx_n_s_buf, __pyx_n_s_out, __pyx_n_s_array, __pyx_n_s_cnt, __pyx_n_s_state, __pyx_n_s_array_data); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(2, 209, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__84);
+  __Pyx_GIVEREF(__pyx_tuple__84);
+  __pyx_codeobj__85 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__84, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_randint_helpers_pxi, __pyx_n_s_rand_int64, 209, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__85)) __PYX_ERR(2, 209, __pyx_L1_error)
 
   /* "randint_helpers.pxi":260
  *         return array
@@ -40258,10 +40333,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  *     """
  *     _rand_uint8(low, high, size, rngstate)
  */
-  __pyx_tuple__85 = PyTuple_Pack(12, __pyx_n_s_low, __pyx_n_s_high, __pyx_n_s_size, __pyx_n_s_rngstate, __pyx_n_s_off, __pyx_n_s_rng, __pyx_n_s_buf, __pyx_n_s_out, __pyx_n_s_array, __pyx_n_s_cnt, __pyx_n_s_state, __pyx_n_s_array_data); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(2, 260, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__85);
-  __Pyx_GIVEREF(__pyx_tuple__85);
-  __pyx_codeobj__86 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_randint_helpers_pxi, __pyx_n_s_rand_uint8, 260, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) __PYX_ERR(2, 260, __pyx_L1_error)
+  __pyx_tuple__86 = PyTuple_Pack(12, __pyx_n_s_low, __pyx_n_s_high, __pyx_n_s_size, __pyx_n_s_rngstate, __pyx_n_s_off, __pyx_n_s_rng, __pyx_n_s_buf, __pyx_n_s_out, __pyx_n_s_array, __pyx_n_s_cnt, __pyx_n_s_state, __pyx_n_s_array_data); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(2, 260, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__86);
+  __Pyx_GIVEREF(__pyx_tuple__86);
+  __pyx_codeobj__87 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_randint_helpers_pxi, __pyx_n_s_rand_uint8, 260, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__87)) __PYX_ERR(2, 260, __pyx_L1_error)
 
   /* "randint_helpers.pxi":311
  *         return array
@@ -40270,10 +40345,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  *     """
  *     _rand_uint16(low, high, size, rngstate)
  */
-  __pyx_tuple__87 = PyTuple_Pack(12, __pyx_n_s_low, __pyx_n_s_high, __pyx_n_s_size, __pyx_n_s_rngstate, __pyx_n_s_off, __pyx_n_s_rng, __pyx_n_s_buf, __pyx_n_s_out, __pyx_n_s_array, __pyx_n_s_cnt, __pyx_n_s_state, __pyx_n_s_array_data); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(2, 311, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__87);
-  __Pyx_GIVEREF(__pyx_tuple__87);
-  __pyx_codeobj__88 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__87, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_randint_helpers_pxi, __pyx_n_s_rand_uint16, 311, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__88)) __PYX_ERR(2, 311, __pyx_L1_error)
+  __pyx_tuple__88 = PyTuple_Pack(12, __pyx_n_s_low, __pyx_n_s_high, __pyx_n_s_size, __pyx_n_s_rngstate, __pyx_n_s_off, __pyx_n_s_rng, __pyx_n_s_buf, __pyx_n_s_out, __pyx_n_s_array, __pyx_n_s_cnt, __pyx_n_s_state, __pyx_n_s_array_data); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(2, 311, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__88);
+  __Pyx_GIVEREF(__pyx_tuple__88);
+  __pyx_codeobj__89 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__88, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_randint_helpers_pxi, __pyx_n_s_rand_uint16, 311, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__89)) __PYX_ERR(2, 311, __pyx_L1_error)
 
   /* "randint_helpers.pxi":362
  *         return array
@@ -40282,10 +40357,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  *     """
  *     _rand_uint32(low, high, size, rngstate)
  */
-  __pyx_tuple__89 = PyTuple_Pack(12, __pyx_n_s_low, __pyx_n_s_high, __pyx_n_s_size, __pyx_n_s_rngstate, __pyx_n_s_off, __pyx_n_s_rng, __pyx_n_s_buf, __pyx_n_s_out, __pyx_n_s_array, __pyx_n_s_cnt, __pyx_n_s_state, __pyx_n_s_array_data); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(2, 362, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__89);
-  __Pyx_GIVEREF(__pyx_tuple__89);
-  __pyx_codeobj__90 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__89, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_randint_helpers_pxi, __pyx_n_s_rand_uint32, 362, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__90)) __PYX_ERR(2, 362, __pyx_L1_error)
+  __pyx_tuple__90 = PyTuple_Pack(12, __pyx_n_s_low, __pyx_n_s_high, __pyx_n_s_size, __pyx_n_s_rngstate, __pyx_n_s_off, __pyx_n_s_rng, __pyx_n_s_buf, __pyx_n_s_out, __pyx_n_s_array, __pyx_n_s_cnt, __pyx_n_s_state, __pyx_n_s_array_data); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(2, 362, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__90);
+  __Pyx_GIVEREF(__pyx_tuple__90);
+  __pyx_codeobj__91 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__90, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_randint_helpers_pxi, __pyx_n_s_rand_uint32, 362, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__91)) __PYX_ERR(2, 362, __pyx_L1_error)
 
   /* "randint_helpers.pxi":413
  *         return array
@@ -40294,10 +40369,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  *     """
  *     _rand_uint64(low, high, size, rngstate)
  */
-  __pyx_tuple__91 = PyTuple_Pack(12, __pyx_n_s_low, __pyx_n_s_high, __pyx_n_s_size, __pyx_n_s_rngstate, __pyx_n_s_off, __pyx_n_s_rng, __pyx_n_s_buf, __pyx_n_s_out, __pyx_n_s_array, __pyx_n_s_cnt, __pyx_n_s_state, __pyx_n_s_array_data); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(2, 413, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__91);
-  __Pyx_GIVEREF(__pyx_tuple__91);
-  __pyx_codeobj__92 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__91, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_randint_helpers_pxi, __pyx_n_s_rand_uint64, 413, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__92)) __PYX_ERR(2, 413, __pyx_L1_error)
+  __pyx_tuple__92 = PyTuple_Pack(12, __pyx_n_s_low, __pyx_n_s_high, __pyx_n_s_size, __pyx_n_s_rngstate, __pyx_n_s_off, __pyx_n_s_rng, __pyx_n_s_buf, __pyx_n_s_out, __pyx_n_s_array, __pyx_n_s_cnt, __pyx_n_s_state, __pyx_n_s_array_data); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(2, 413, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__92);
+  __Pyx_GIVEREF(__pyx_tuple__92);
+  __pyx_codeobj__93 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__92, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_randint_helpers_pxi, __pyx_n_s_rand_uint64, 413, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__93)) __PYX_ERR(2, 413, __pyx_L1_error)
 
   /* "mtrand.pyx":566
  *     return sum
@@ -40306,10 +40381,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  *     if size is None:
  *         shape = (d,)
  */
-  __pyx_tuple__93 = PyTuple_Pack(3, __pyx_n_s_size, __pyx_n_s_d, __pyx_n_s_shape); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(0, 566, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__93);
-  __Pyx_GIVEREF(__pyx_tuple__93);
-  __pyx_codeobj__94 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__93, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mtrand_pyx, __pyx_n_s_shape_from_size, 566, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__94)) __PYX_ERR(0, 566, __pyx_L1_error)
+  __pyx_tuple__94 = PyTuple_Pack(3, __pyx_n_s_size, __pyx_n_s_d, __pyx_n_s_shape); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(0, 566, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__94);
+  __Pyx_GIVEREF(__pyx_tuple__94);
+  __pyx_codeobj__95 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__94, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mtrand_pyx, __pyx_n_s_shape_from_size, 566, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__95)) __PYX_ERR(0, 566, __pyx_L1_error)
   __Pyx_RefNannyFinishContext();
   return 0;
   __pyx_L1_error:;
@@ -41381,718 +41456,718 @@ if (!__Pyx_RefNanny) {
   __pyx_k__13 = ((PyObject *)(&PyInt_Type));
   __Pyx_GIVEREF((&PyInt_Type));
 
-  /* "mtrand.pyx":4921
+  /* "mtrand.pyx":4931
  * 
  * 
  * _rand = RandomState()             # <<<<<<<<<<<<<<
  * seed = _rand.seed
  * get_state = _rand.get_state
  */
-  __pyx_t_7 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6mtrand_RandomState)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4921, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6mtrand_RandomState)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4931, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_rand_2, __pyx_t_7) < 0) __PYX_ERR(0, 4921, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_rand_2, __pyx_t_7) < 0) __PYX_ERR(0, 4931, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "mtrand.pyx":4922
+  /* "mtrand.pyx":4932
  * 
  * _rand = RandomState()
  * seed = _rand.seed             # <<<<<<<<<<<<<<
  * get_state = _rand.get_state
  * set_state = _rand.set_state
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4922, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4932, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_seed); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4922, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_seed); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4932, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_seed, __pyx_t_9) < 0) __PYX_ERR(0, 4922, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_seed, __pyx_t_9) < 0) __PYX_ERR(0, 4932, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-  /* "mtrand.pyx":4923
+  /* "mtrand.pyx":4933
  * _rand = RandomState()
  * seed = _rand.seed
  * get_state = _rand.get_state             # <<<<<<<<<<<<<<
  * set_state = _rand.set_state
  * random_sample = _rand.random_sample
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4923, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4933, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_get_state); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4923, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_get_state); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4933, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_state, __pyx_t_7) < 0) __PYX_ERR(0, 4923, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_state, __pyx_t_7) < 0) __PYX_ERR(0, 4933, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "mtrand.pyx":4924
+  /* "mtrand.pyx":4934
  * seed = _rand.seed
  * get_state = _rand.get_state
  * set_state = _rand.set_state             # <<<<<<<<<<<<<<
  * random_sample = _rand.random_sample
  * choice = _rand.choice
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4924, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4934, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_set_state); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4924, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_set_state); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4934, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_state, __pyx_t_9) < 0) __PYX_ERR(0, 4924, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_state, __pyx_t_9) < 0) __PYX_ERR(0, 4934, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-  /* "mtrand.pyx":4925
+  /* "mtrand.pyx":4935
  * get_state = _rand.get_state
  * set_state = _rand.set_state
  * random_sample = _rand.random_sample             # <<<<<<<<<<<<<<
  * choice = _rand.choice
  * randint = _rand.randint
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4925, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4935, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_random_sample); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4925, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_random_sample); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4935, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_random_sample, __pyx_t_7) < 0) __PYX_ERR(0, 4925, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_random_sample, __pyx_t_7) < 0) __PYX_ERR(0, 4935, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "mtrand.pyx":4926
+  /* "mtrand.pyx":4936
  * set_state = _rand.set_state
  * random_sample = _rand.random_sample
  * choice = _rand.choice             # <<<<<<<<<<<<<<
  * randint = _rand.randint
  * bytes = _rand.bytes
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4926, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4936, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_choice); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4926, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_choice); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4936, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_choice, __pyx_t_9) < 0) __PYX_ERR(0, 4926, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_choice, __pyx_t_9) < 0) __PYX_ERR(0, 4936, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-  /* "mtrand.pyx":4927
+  /* "mtrand.pyx":4937
  * random_sample = _rand.random_sample
  * choice = _rand.choice
  * randint = _rand.randint             # <<<<<<<<<<<<<<
  * bytes = _rand.bytes
  * uniform = _rand.uniform
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4927, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4937, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_randint); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4927, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_randint); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4937, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_randint, __pyx_t_7) < 0) __PYX_ERR(0, 4927, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_randint, __pyx_t_7) < 0) __PYX_ERR(0, 4937, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "mtrand.pyx":4928
+  /* "mtrand.pyx":4938
  * choice = _rand.choice
  * randint = _rand.randint
  * bytes = _rand.bytes             # <<<<<<<<<<<<<<
  * uniform = _rand.uniform
  * rand = _rand.rand
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4928, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4938, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_bytes); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4928, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_bytes); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4938, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_bytes, __pyx_t_9) < 0) __PYX_ERR(0, 4928, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_bytes, __pyx_t_9) < 0) __PYX_ERR(0, 4938, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-  /* "mtrand.pyx":4929
+  /* "mtrand.pyx":4939
  * randint = _rand.randint
  * bytes = _rand.bytes
  * uniform = _rand.uniform             # <<<<<<<<<<<<<<
  * rand = _rand.rand
  * randn = _rand.randn
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4929, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4939, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_uniform); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4929, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_uniform); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4939, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_uniform, __pyx_t_7) < 0) __PYX_ERR(0, 4929, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_uniform, __pyx_t_7) < 0) __PYX_ERR(0, 4939, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "mtrand.pyx":4930
+  /* "mtrand.pyx":4940
  * bytes = _rand.bytes
  * uniform = _rand.uniform
  * rand = _rand.rand             # <<<<<<<<<<<<<<
  * randn = _rand.randn
  * random_integers = _rand.random_integers
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4930, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4940, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_rand); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4930, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_rand); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4940, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_rand, __pyx_t_9) < 0) __PYX_ERR(0, 4930, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_rand, __pyx_t_9) < 0) __PYX_ERR(0, 4940, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-  /* "mtrand.pyx":4931
+  /* "mtrand.pyx":4941
  * uniform = _rand.uniform
  * rand = _rand.rand
  * randn = _rand.randn             # <<<<<<<<<<<<<<
  * random_integers = _rand.random_integers
  * standard_normal = _rand.standard_normal
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4931, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4941, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_randn); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4931, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_randn); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4941, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_randn, __pyx_t_7) < 0) __PYX_ERR(0, 4931, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_randn, __pyx_t_7) < 0) __PYX_ERR(0, 4941, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "mtrand.pyx":4932
+  /* "mtrand.pyx":4942
  * rand = _rand.rand
  * randn = _rand.randn
  * random_integers = _rand.random_integers             # <<<<<<<<<<<<<<
  * standard_normal = _rand.standard_normal
  * normal = _rand.normal
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4932, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4942, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_random_integers); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4932, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_random_integers); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4942, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_random_integers, __pyx_t_9) < 0) __PYX_ERR(0, 4932, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_random_integers, __pyx_t_9) < 0) __PYX_ERR(0, 4942, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-  /* "mtrand.pyx":4933
+  /* "mtrand.pyx":4943
  * randn = _rand.randn
  * random_integers = _rand.random_integers
  * standard_normal = _rand.standard_normal             # <<<<<<<<<<<<<<
  * normal = _rand.normal
  * beta = _rand.beta
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4933, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4943, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_standard_normal); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4933, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_standard_normal); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4943, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_standard_normal, __pyx_t_7) < 0) __PYX_ERR(0, 4933, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_standard_normal, __pyx_t_7) < 0) __PYX_ERR(0, 4943, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "mtrand.pyx":4934
+  /* "mtrand.pyx":4944
  * random_integers = _rand.random_integers
  * standard_normal = _rand.standard_normal
  * normal = _rand.normal             # <<<<<<<<<<<<<<
  * beta = _rand.beta
  * exponential = _rand.exponential
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4934, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4944, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_normal); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4934, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_normal); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4944, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_normal, __pyx_t_9) < 0) __PYX_ERR(0, 4934, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_normal, __pyx_t_9) < 0) __PYX_ERR(0, 4944, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-  /* "mtrand.pyx":4935
+  /* "mtrand.pyx":4945
  * standard_normal = _rand.standard_normal
  * normal = _rand.normal
  * beta = _rand.beta             # <<<<<<<<<<<<<<
  * exponential = _rand.exponential
  * standard_exponential = _rand.standard_exponential
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4935, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4945, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_beta); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4935, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_beta); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4945, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_beta, __pyx_t_7) < 0) __PYX_ERR(0, 4935, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_beta, __pyx_t_7) < 0) __PYX_ERR(0, 4945, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "mtrand.pyx":4936
+  /* "mtrand.pyx":4946
  * normal = _rand.normal
  * beta = _rand.beta
  * exponential = _rand.exponential             # <<<<<<<<<<<<<<
  * standard_exponential = _rand.standard_exponential
  * standard_gamma = _rand.standard_gamma
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4936, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4946, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_exponential); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4936, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_exponential); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4946, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_exponential, __pyx_t_9) < 0) __PYX_ERR(0, 4936, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_exponential, __pyx_t_9) < 0) __PYX_ERR(0, 4946, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-  /* "mtrand.pyx":4937
+  /* "mtrand.pyx":4947
  * beta = _rand.beta
  * exponential = _rand.exponential
  * standard_exponential = _rand.standard_exponential             # <<<<<<<<<<<<<<
  * standard_gamma = _rand.standard_gamma
  * gamma = _rand.gamma
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4937, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4947, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_standard_exponential); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4937, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_standard_exponential); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4947, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_standard_exponential, __pyx_t_7) < 0) __PYX_ERR(0, 4937, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_standard_exponential, __pyx_t_7) < 0) __PYX_ERR(0, 4947, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "mtrand.pyx":4938
+  /* "mtrand.pyx":4948
  * exponential = _rand.exponential
  * standard_exponential = _rand.standard_exponential
  * standard_gamma = _rand.standard_gamma             # <<<<<<<<<<<<<<
  * gamma = _rand.gamma
  * f = _rand.f
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4938, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4948, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_standard_gamma); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4938, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_standard_gamma); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4948, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_standard_gamma, __pyx_t_9) < 0) __PYX_ERR(0, 4938, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_standard_gamma, __pyx_t_9) < 0) __PYX_ERR(0, 4948, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-  /* "mtrand.pyx":4939
+  /* "mtrand.pyx":4949
  * standard_exponential = _rand.standard_exponential
  * standard_gamma = _rand.standard_gamma
  * gamma = _rand.gamma             # <<<<<<<<<<<<<<
  * f = _rand.f
  * noncentral_f = _rand.noncentral_f
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4939, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4949, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_gamma); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4939, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_gamma); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4949, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_gamma, __pyx_t_7) < 0) __PYX_ERR(0, 4939, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_gamma, __pyx_t_7) < 0) __PYX_ERR(0, 4949, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "mtrand.pyx":4940
+  /* "mtrand.pyx":4950
  * standard_gamma = _rand.standard_gamma
  * gamma = _rand.gamma
  * f = _rand.f             # <<<<<<<<<<<<<<
  * noncentral_f = _rand.noncentral_f
  * chisquare = _rand.chisquare
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4940, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4950, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_f); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4940, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_f); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4950, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_f, __pyx_t_9) < 0) __PYX_ERR(0, 4940, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_f, __pyx_t_9) < 0) __PYX_ERR(0, 4950, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-  /* "mtrand.pyx":4941
+  /* "mtrand.pyx":4951
  * gamma = _rand.gamma
  * f = _rand.f
  * noncentral_f = _rand.noncentral_f             # <<<<<<<<<<<<<<
  * chisquare = _rand.chisquare
  * noncentral_chisquare = _rand.noncentral_chisquare
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4941, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4951, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_noncentral_f); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4941, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_noncentral_f); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4951, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_noncentral_f, __pyx_t_7) < 0) __PYX_ERR(0, 4941, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_noncentral_f, __pyx_t_7) < 0) __PYX_ERR(0, 4951, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "mtrand.pyx":4942
+  /* "mtrand.pyx":4952
  * f = _rand.f
  * noncentral_f = _rand.noncentral_f
  * chisquare = _rand.chisquare             # <<<<<<<<<<<<<<
  * noncentral_chisquare = _rand.noncentral_chisquare
  * standard_cauchy = _rand.standard_cauchy
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4942, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4952, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_chisquare); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4942, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_chisquare); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4952, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_chisquare, __pyx_t_9) < 0) __PYX_ERR(0, 4942, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_chisquare, __pyx_t_9) < 0) __PYX_ERR(0, 4952, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-  /* "mtrand.pyx":4943
+  /* "mtrand.pyx":4953
  * noncentral_f = _rand.noncentral_f
  * chisquare = _rand.chisquare
  * noncentral_chisquare = _rand.noncentral_chisquare             # <<<<<<<<<<<<<<
  * standard_cauchy = _rand.standard_cauchy
  * standard_t = _rand.standard_t
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4943, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4953, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_noncentral_chisquare); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4943, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_noncentral_chisquare); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4953, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_noncentral_chisquare, __pyx_t_7) < 0) __PYX_ERR(0, 4943, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_noncentral_chisquare, __pyx_t_7) < 0) __PYX_ERR(0, 4953, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "mtrand.pyx":4944
+  /* "mtrand.pyx":4954
  * chisquare = _rand.chisquare
  * noncentral_chisquare = _rand.noncentral_chisquare
  * standard_cauchy = _rand.standard_cauchy             # <<<<<<<<<<<<<<
  * standard_t = _rand.standard_t
  * vonmises = _rand.vonmises
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4944, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4954, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_standard_cauchy); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4944, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_standard_cauchy); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4954, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_standard_cauchy, __pyx_t_9) < 0) __PYX_ERR(0, 4944, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_standard_cauchy, __pyx_t_9) < 0) __PYX_ERR(0, 4954, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-  /* "mtrand.pyx":4945
+  /* "mtrand.pyx":4955
  * noncentral_chisquare = _rand.noncentral_chisquare
  * standard_cauchy = _rand.standard_cauchy
  * standard_t = _rand.standard_t             # <<<<<<<<<<<<<<
  * vonmises = _rand.vonmises
  * pareto = _rand.pareto
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4945, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4955, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_standard_t); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4945, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_standard_t); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4955, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_standard_t, __pyx_t_7) < 0) __PYX_ERR(0, 4945, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_standard_t, __pyx_t_7) < 0) __PYX_ERR(0, 4955, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "mtrand.pyx":4946
+  /* "mtrand.pyx":4956
  * standard_cauchy = _rand.standard_cauchy
  * standard_t = _rand.standard_t
  * vonmises = _rand.vonmises             # <<<<<<<<<<<<<<
  * pareto = _rand.pareto
  * weibull = _rand.weibull
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4946, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4956, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_vonmises); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4946, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_vonmises); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4956, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_vonmises, __pyx_t_9) < 0) __PYX_ERR(0, 4946, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_vonmises, __pyx_t_9) < 0) __PYX_ERR(0, 4956, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-  /* "mtrand.pyx":4947
+  /* "mtrand.pyx":4957
  * standard_t = _rand.standard_t
  * vonmises = _rand.vonmises
  * pareto = _rand.pareto             # <<<<<<<<<<<<<<
  * weibull = _rand.weibull
  * power = _rand.power
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4947, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4957, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_pareto); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4947, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_pareto); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4957, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pareto, __pyx_t_7) < 0) __PYX_ERR(0, 4947, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pareto, __pyx_t_7) < 0) __PYX_ERR(0, 4957, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "mtrand.pyx":4948
+  /* "mtrand.pyx":4958
  * vonmises = _rand.vonmises
  * pareto = _rand.pareto
  * weibull = _rand.weibull             # <<<<<<<<<<<<<<
  * power = _rand.power
  * laplace = _rand.laplace
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4948, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4958, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_weibull); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4948, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_weibull); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4958, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_weibull, __pyx_t_9) < 0) __PYX_ERR(0, 4948, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_weibull, __pyx_t_9) < 0) __PYX_ERR(0, 4958, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-  /* "mtrand.pyx":4949
+  /* "mtrand.pyx":4959
  * pareto = _rand.pareto
  * weibull = _rand.weibull
  * power = _rand.power             # <<<<<<<<<<<<<<
  * laplace = _rand.laplace
  * gumbel = _rand.gumbel
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4949, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4959, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_power); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4949, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_power); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4959, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_power, __pyx_t_7) < 0) __PYX_ERR(0, 4949, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_power, __pyx_t_7) < 0) __PYX_ERR(0, 4959, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "mtrand.pyx":4950
+  /* "mtrand.pyx":4960
  * weibull = _rand.weibull
  * power = _rand.power
  * laplace = _rand.laplace             # <<<<<<<<<<<<<<
  * gumbel = _rand.gumbel
  * logistic = _rand.logistic
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4950, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4960, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_laplace); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4950, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_laplace); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4960, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_laplace, __pyx_t_9) < 0) __PYX_ERR(0, 4950, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_laplace, __pyx_t_9) < 0) __PYX_ERR(0, 4960, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-  /* "mtrand.pyx":4951
+  /* "mtrand.pyx":4961
  * power = _rand.power
  * laplace = _rand.laplace
  * gumbel = _rand.gumbel             # <<<<<<<<<<<<<<
  * logistic = _rand.logistic
  * lognormal = _rand.lognormal
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4951, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4961, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_gumbel); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4951, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_gumbel); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4961, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_gumbel, __pyx_t_7) < 0) __PYX_ERR(0, 4951, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_gumbel, __pyx_t_7) < 0) __PYX_ERR(0, 4961, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "mtrand.pyx":4952
+  /* "mtrand.pyx":4962
  * laplace = _rand.laplace
  * gumbel = _rand.gumbel
  * logistic = _rand.logistic             # <<<<<<<<<<<<<<
  * lognormal = _rand.lognormal
  * rayleigh = _rand.rayleigh
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4952, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4962, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_logistic); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4952, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_logistic); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4962, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_logistic, __pyx_t_9) < 0) __PYX_ERR(0, 4952, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_logistic, __pyx_t_9) < 0) __PYX_ERR(0, 4962, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-  /* "mtrand.pyx":4953
+  /* "mtrand.pyx":4963
  * gumbel = _rand.gumbel
  * logistic = _rand.logistic
  * lognormal = _rand.lognormal             # <<<<<<<<<<<<<<
  * rayleigh = _rand.rayleigh
  * wald = _rand.wald
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4953, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4963, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_lognormal); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4953, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_lognormal); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4963, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_lognormal, __pyx_t_7) < 0) __PYX_ERR(0, 4953, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_lognormal, __pyx_t_7) < 0) __PYX_ERR(0, 4963, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "mtrand.pyx":4954
+  /* "mtrand.pyx":4964
  * logistic = _rand.logistic
  * lognormal = _rand.lognormal
  * rayleigh = _rand.rayleigh             # <<<<<<<<<<<<<<
  * wald = _rand.wald
  * triangular = _rand.triangular
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4954, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4964, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_rayleigh); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4954, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_rayleigh); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4964, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_rayleigh, __pyx_t_9) < 0) __PYX_ERR(0, 4954, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_rayleigh, __pyx_t_9) < 0) __PYX_ERR(0, 4964, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-  /* "mtrand.pyx":4955
+  /* "mtrand.pyx":4965
  * lognormal = _rand.lognormal
  * rayleigh = _rand.rayleigh
  * wald = _rand.wald             # <<<<<<<<<<<<<<
  * triangular = _rand.triangular
  * 
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4955, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4965, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_wald); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4955, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_wald); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4965, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_wald, __pyx_t_7) < 0) __PYX_ERR(0, 4955, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_wald, __pyx_t_7) < 0) __PYX_ERR(0, 4965, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "mtrand.pyx":4956
+  /* "mtrand.pyx":4966
  * rayleigh = _rand.rayleigh
  * wald = _rand.wald
  * triangular = _rand.triangular             # <<<<<<<<<<<<<<
  * 
  * binomial = _rand.binomial
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4956, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4966, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_triangular); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4956, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_triangular); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4966, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_triangular, __pyx_t_9) < 0) __PYX_ERR(0, 4956, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_triangular, __pyx_t_9) < 0) __PYX_ERR(0, 4966, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-  /* "mtrand.pyx":4958
+  /* "mtrand.pyx":4968
  * triangular = _rand.triangular
  * 
  * binomial = _rand.binomial             # <<<<<<<<<<<<<<
  * negative_binomial = _rand.negative_binomial
  * poisson = _rand.poisson
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4958, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4968, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_binomial); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4958, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_binomial); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4968, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_binomial, __pyx_t_7) < 0) __PYX_ERR(0, 4958, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_binomial, __pyx_t_7) < 0) __PYX_ERR(0, 4968, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "mtrand.pyx":4959
+  /* "mtrand.pyx":4969
  * 
  * binomial = _rand.binomial
  * negative_binomial = _rand.negative_binomial             # <<<<<<<<<<<<<<
  * poisson = _rand.poisson
  * zipf = _rand.zipf
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4959, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4969, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_negative_binomial); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4959, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_negative_binomial); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4969, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_negative_binomial, __pyx_t_9) < 0) __PYX_ERR(0, 4959, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_negative_binomial, __pyx_t_9) < 0) __PYX_ERR(0, 4969, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-  /* "mtrand.pyx":4960
+  /* "mtrand.pyx":4970
  * binomial = _rand.binomial
  * negative_binomial = _rand.negative_binomial
  * poisson = _rand.poisson             # <<<<<<<<<<<<<<
  * zipf = _rand.zipf
  * geometric = _rand.geometric
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4960, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4970, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_poisson); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4960, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_poisson); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4970, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_poisson, __pyx_t_7) < 0) __PYX_ERR(0, 4960, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_poisson, __pyx_t_7) < 0) __PYX_ERR(0, 4970, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "mtrand.pyx":4961
+  /* "mtrand.pyx":4971
  * negative_binomial = _rand.negative_binomial
  * poisson = _rand.poisson
  * zipf = _rand.zipf             # <<<<<<<<<<<<<<
  * geometric = _rand.geometric
  * hypergeometric = _rand.hypergeometric
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4961, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4971, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_zipf); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4961, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_zipf); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4971, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_zipf, __pyx_t_9) < 0) __PYX_ERR(0, 4961, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_zipf, __pyx_t_9) < 0) __PYX_ERR(0, 4971, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-  /* "mtrand.pyx":4962
+  /* "mtrand.pyx":4972
  * poisson = _rand.poisson
  * zipf = _rand.zipf
  * geometric = _rand.geometric             # <<<<<<<<<<<<<<
  * hypergeometric = _rand.hypergeometric
  * logseries = _rand.logseries
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4962, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4972, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_geometric); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4962, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_geometric); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4972, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_geometric, __pyx_t_7) < 0) __PYX_ERR(0, 4962, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_geometric, __pyx_t_7) < 0) __PYX_ERR(0, 4972, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "mtrand.pyx":4963
+  /* "mtrand.pyx":4973
  * zipf = _rand.zipf
  * geometric = _rand.geometric
  * hypergeometric = _rand.hypergeometric             # <<<<<<<<<<<<<<
  * logseries = _rand.logseries
  * 
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4963, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4973, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_hypergeometric); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4963, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_hypergeometric); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4973, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_hypergeometric, __pyx_t_9) < 0) __PYX_ERR(0, 4963, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_hypergeometric, __pyx_t_9) < 0) __PYX_ERR(0, 4973, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-  /* "mtrand.pyx":4964
+  /* "mtrand.pyx":4974
  * geometric = _rand.geometric
  * hypergeometric = _rand.hypergeometric
  * logseries = _rand.logseries             # <<<<<<<<<<<<<<
  * 
  * multivariate_normal = _rand.multivariate_normal
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4964, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4974, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_logseries); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4964, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_logseries); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4974, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_logseries, __pyx_t_7) < 0) __PYX_ERR(0, 4964, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_logseries, __pyx_t_7) < 0) __PYX_ERR(0, 4974, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "mtrand.pyx":4966
+  /* "mtrand.pyx":4976
  * logseries = _rand.logseries
  * 
  * multivariate_normal = _rand.multivariate_normal             # <<<<<<<<<<<<<<
  * multinomial = _rand.multinomial
  * dirichlet = _rand.dirichlet
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4966, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4976, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_multivariate_normal); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4966, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_multivariate_normal); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4976, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_multivariate_normal, __pyx_t_9) < 0) __PYX_ERR(0, 4966, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_multivariate_normal, __pyx_t_9) < 0) __PYX_ERR(0, 4976, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-  /* "mtrand.pyx":4967
+  /* "mtrand.pyx":4977
  * 
  * multivariate_normal = _rand.multivariate_normal
  * multinomial = _rand.multinomial             # <<<<<<<<<<<<<<
  * dirichlet = _rand.dirichlet
  * 
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4967, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4977, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_multinomial); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4967, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_multinomial); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4977, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_multinomial, __pyx_t_7) < 0) __PYX_ERR(0, 4967, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_multinomial, __pyx_t_7) < 0) __PYX_ERR(0, 4977, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "mtrand.pyx":4968
+  /* "mtrand.pyx":4978
  * multivariate_normal = _rand.multivariate_normal
  * multinomial = _rand.multinomial
  * dirichlet = _rand.dirichlet             # <<<<<<<<<<<<<<
  * 
  * shuffle = _rand.shuffle
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4968, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4978, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_dirichlet); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4968, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_dirichlet); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4978, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_dirichlet, __pyx_t_9) < 0) __PYX_ERR(0, 4968, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_dirichlet, __pyx_t_9) < 0) __PYX_ERR(0, 4978, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-  /* "mtrand.pyx":4970
+  /* "mtrand.pyx":4980
  * dirichlet = _rand.dirichlet
  * 
  * shuffle = _rand.shuffle             # <<<<<<<<<<<<<<
  * permutation = _rand.permutation
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4970, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4980, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_shuffle); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4970, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_shuffle); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4980, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_shuffle, __pyx_t_7) < 0) __PYX_ERR(0, 4970, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_shuffle, __pyx_t_7) < 0) __PYX_ERR(0, 4980, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "mtrand.pyx":4971
+  /* "mtrand.pyx":4981
  * 
  * shuffle = _rand.shuffle
  * permutation = _rand.permutation             # <<<<<<<<<<<<<<
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4971, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4981, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_permutation); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4971, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_permutation); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4981, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_permutation, __pyx_t_9) < 0) __PYX_ERR(0, 4971, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_permutation, __pyx_t_9) < 0) __PYX_ERR(0, 4981, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
   /* "mtrand.pyx":1
@@ -42107,44 +42182,44 @@ if (!__Pyx_RefNanny) {
   if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_randint_line_910, __pyx_kp_u_randint_low_high_None_size_None) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
   if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_bytes_line_1003, __pyx_kp_u_bytes_length_Return_random_byte) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
   if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_choice_line_1032, __pyx_kp_u_choice_a_size_None_replace_True) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_uniform_line_1214, __pyx_kp_u_uniform_low_0_0_high_1_0_size_N) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_rand_line_1320, __pyx_kp_u_rand_d0_d1_dn_Random_values_in) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_randn_line_1364, __pyx_kp_u_randn_d0_d1_dn_Return_a_sample) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_uniform_line_1217, __pyx_kp_u_uniform_low_0_0_high_1_0_size_N) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_rand_line_1323, __pyx_kp_u_rand_d0_d1_dn_Random_values_in) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_randn_line_1367, __pyx_kp_u_randn_d0_d1_dn_Return_a_sample) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
   if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_random_integers_line, __pyx_kp_u_random_integers_low_high_None_s) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
   if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_standard_normal_line, __pyx_kp_u_standard_normal_size_None_Draw) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_normal_line_1551, __pyx_kp_u_normal_loc_0_0_scale_1_0_size_N) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_normal_line_1554, __pyx_kp_u_normal_loc_0_0_scale_1_0_size_N) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
   if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_standard_exponential, __pyx_kp_u_standard_exponential_size_None) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
   if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_standard_gamma_line, __pyx_kp_u_standard_gamma_shape_size_None) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_gamma_line_1900, __pyx_kp_u_gamma_shape_scale_1_0_size_None) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_f_line_1996, __pyx_kp_u_f_dfnum_dfden_size_None_Draw_sa) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_gamma_line_1903, __pyx_kp_u_gamma_shape_scale_1_0_size_None) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_f_line_1999, __pyx_kp_u_f_dfnum_dfden_size_None_Draw_sa) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
   if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_noncentral_f_line_21, __pyx_kp_u_noncentral_f_dfnum_dfden_nonc_s) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_chisquare_line_2204, __pyx_kp_u_chisquare_df_size_None_Draw_sam) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_chisquare_line_2208, __pyx_kp_u_chisquare_df_size_None_Draw_sam) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
   if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_noncentral_chisquare, __pyx_kp_u_noncentral_chisquare_df_nonc_si) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
   if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_standard_cauchy_line, __pyx_kp_u_standard_cauchy_size_None_Draw) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_standard_t_line_2455, __pyx_kp_u_standard_t_df_size_None_Draw_sa) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_vonmises_line_2561, __pyx_kp_u_vonmises_mu_kappa_size_None_Dra) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_pareto_line_2659, __pyx_kp_u_pareto_a_size_None_Draw_samples) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_weibull_line_2769, __pyx_kp_u_weibull_a_size_None_Draw_sample) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_power_line_2879, __pyx_kp_u_power_a_size_None_Draws_samples) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_laplace_line_2990, __pyx_kp_u_laplace_loc_0_0_scale_1_0_size) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_gumbel_line_3088, __pyx_kp_u_gumbel_loc_0_0_scale_1_0_size_N) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_logistic_line_3219, __pyx_kp_u_logistic_loc_0_0_scale_1_0_size) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_lognormal_line_3312, __pyx_kp_u_lognormal_mean_0_0_sigma_1_0_si) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_rayleigh_line_3436, __pyx_kp_u_rayleigh_scale_1_0_size_None_Dr) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_wald_line_3515, __pyx_kp_u_wald_mean_scale_size_None_Draw) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_triangular_line_3602, __pyx_kp_u_triangular_left_mode_right_size) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_binomial_line_3696, __pyx_kp_u_binomial_n_p_size_None_Draw_sam) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_standard_t_line_2460, __pyx_kp_u_standard_t_df_size_None_Draw_sa) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_vonmises_line_2566, __pyx_kp_u_vonmises_mu_kappa_size_None_Dra) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_pareto_line_2664, __pyx_kp_u_pareto_a_size_None_Draw_samples) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_weibull_line_2774, __pyx_kp_u_weibull_a_size_None_Draw_sample) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_power_line_2884, __pyx_kp_u_power_a_size_None_Draws_samples) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_laplace_line_2995, __pyx_kp_u_laplace_loc_0_0_scale_1_0_size) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_gumbel_line_3093, __pyx_kp_u_gumbel_loc_0_0_scale_1_0_size_N) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_logistic_line_3224, __pyx_kp_u_logistic_loc_0_0_scale_1_0_size) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_lognormal_line_3318, __pyx_kp_u_lognormal_mean_0_0_sigma_1_0_si) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_rayleigh_line_3442, __pyx_kp_u_rayleigh_scale_1_0_size_None_Dr) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_wald_line_3522, __pyx_kp_u_wald_mean_scale_size_None_Draw) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_triangular_line_3609, __pyx_kp_u_triangular_left_mode_right_size) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_binomial_line_3703, __pyx_kp_u_binomial_n_p_size_None_Draw_sam) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
   if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_negative_binomial_li, __pyx_kp_u_negative_binomial_n_p_size_None) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_poisson_line_3911, __pyx_kp_u_poisson_lam_1_0_size_None_Draw) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_zipf_line_3999, __pyx_kp_u_zipf_a_size_None_Draw_samples_f) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_geometric_line_4092, __pyx_kp_u_geometric_p_size_None_Draw_samp) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_poisson_line_3918, __pyx_kp_u_poisson_lam_1_0_size_None_Draw) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_zipf_line_4006, __pyx_kp_u_zipf_a_size_None_Draw_samples_f) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_geometric_line_4099, __pyx_kp_u_geometric_p_size_None_Draw_samp) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
   if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_hypergeometric_line, __pyx_kp_u_hypergeometric_ngood_nbad_nsamp) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_logseries_line_4282, __pyx_kp_u_logseries_p_size_None_Draw_samp) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_logseries_line_4290, __pyx_kp_u_logseries_p_size_None_Draw_samp) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
   if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_multivariate_normal, __pyx_kp_u_multivariate_normal_mean_cov_si) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_multinomial_line_454, __pyx_kp_u_multinomial_n_pvals_size_None_D) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_dirichlet_line_4654, __pyx_kp_u_dirichlet_alpha_size_None_Draw) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_shuffle_line_4777, __pyx_kp_u_shuffle_x_Modify_a_sequence_in) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_permutation_line_486, __pyx_kp_u_permutation_x_Randomly_permute) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_multinomial_line_455, __pyx_kp_u_multinomial_n_pvals_size_None_D) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_dirichlet_line_4663, __pyx_kp_u_dirichlet_alpha_size_None_Draw) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_shuffle_line_4787, __pyx_kp_u_shuffle_x_Modify_a_sequence_in) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_9, __pyx_kp_u_RandomState_permutation_line_487, __pyx_kp_u_permutation_x_Randomly_permute) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
   if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_9) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
diff --git a/numpy/random/mtrand/mtrand.pyx b/numpy/random/mtrand/mtrand.pyx
index 21bc73e544beeb9aac50f7233389e71e6ec91c5a..c0561137bf81024032f0c07c06e114705df39c2d 100644
--- a/numpy/random/mtrand/mtrand.pyx
+++ b/numpy/random/mtrand/mtrand.pyx
@@ -1139,9 +1139,12 @@ cdef class RandomState:
                 raise ValueError("'p' must be 1-dimensional")
             if p.size != pop_size:
                 raise ValueError("'a' and 'p' must have same size")
+            p_sum = kahan_sum(pix, d)
+            if np.isnan(p_sum):
+                raise ValueError("probabilities contain NaN")
             if np.logical_or.reduce(p < 0):
                 raise ValueError("probabilities are not non-negative")
-            if abs(kahan_sum(pix, d) - 1.) > atol:
+            if abs(p_sum - 1.) > atol:
                 raise ValueError("probabilities do not sum to 1")
 
         shape = size
@@ -2166,6 +2169,7 @@ cdef class RandomState:
         >>> NF = np.histogram(nc_vals, bins=50, density=True)
         >>> c_vals = np.random.f(dfnum, dfden, 1000000)
         >>> F = np.histogram(c_vals, bins=50, density=True)
+        >>> import matplotlib.pyplot as plt
         >>> plt.plot(F[1][1:], F[0])
         >>> plt.plot(NF[1][1:], NF[0])
         >>> plt.show()
@@ -2443,6 +2447,7 @@ cdef class RandomState:
         --------
         Draw samples and plot the distribution:
 
+        >>> import matplotlib.pyplot as plt
         >>> s = np.random.standard_cauchy(1000000)
         >>> s = s[(s>-25) & (s<25)]  # truncate distribution so it plots well
         >>> plt.hist(s, bins=100)
@@ -3279,6 +3284,7 @@ cdef class RandomState:
 
         >>> loc, scale = 10, 1
         >>> s = np.random.logistic(loc, scale, 10000)
+        >>> import matplotlib.pyplot as plt
         >>> count, bins, ignored = plt.hist(s, bins=50)
 
         #   plot against distribution
@@ -3479,6 +3485,7 @@ cdef class RandomState:
         --------
         Draw values from the distribution and plot the histogram
 
+        >>> from matplotlib.pyplot import hist
         >>> values = hist(np.random.rayleigh(3, 100000), bins=200, density=True)
 
         Wave heights tend to follow a Rayleigh distribution. If the mean wave
@@ -4233,6 +4240,7 @@ cdef class RandomState:
         >>> ngood, nbad, nsamp = 100, 2, 10
         # number of good, number of bad, and number of samples
         >>> s = np.random.hypergeometric(ngood, nbad, nsamp, 1000)
+        >>> from matplotlib.pyplot import hist
         >>> hist(s)
         #   note that it is very unlikely to grab both bad items
 
@@ -4342,6 +4350,7 @@ cdef class RandomState:
 
         >>> a = .6
         >>> s = np.random.logseries(a, 10000)
+        >>> import matplotlib.pyplot as plt
         >>> count, bins, ignored = plt.hist(s)
 
         #   plot against distribution
@@ -4710,6 +4719,7 @@ cdef class RandomState:
 
         >>> s = np.random.dirichlet((10, 5, 3), 20).transpose()
 
+        >>> import matplotlib.pyplot as plt
         >>> plt.barh(range(20), s[0])
         >>> plt.barh(range(20), s[1], left=s[0], color='g')
         >>> plt.barh(range(20), s[2], left=s[0]+s[1], color='r')
diff --git a/numpy/random/tests/test_random.py b/numpy/random/tests/test_random.py
index d0bb92a738954a259836a46691711c4c1a20d2d6..d4721bc62c9263e81dd5a861ee3246a50baab258 100644
--- a/numpy/random/tests/test_random.py
+++ b/numpy/random/tests/test_random.py
@@ -448,6 +448,11 @@ class TestRandomDist(object):
         assert_equal(np.random.choice(['a', 'b'], size=(3, 0, 4)).shape, (3, 0, 4))
         assert_raises(ValueError, np.random.choice, [], 10)
 
+    def test_choice_nan_probabilities(self):
+        a = np.array([42, 1, 2])
+        p = [None, None, None]
+        assert_raises(ValueError, np.random.choice, a, p=p)
+
     def test_bytes(self):
         np.random.seed(self.seed)
         actual = np.random.bytes(10)
diff --git a/numpy/testing/_private/nosetester.py b/numpy/testing/_private/nosetester.py
index 1728d9d1f5b34ab7fb092c0f74f11104fc22117f..19569a5098a1b745c2859c9137248c7d652b3e86 100644
--- a/numpy/testing/_private/nosetester.py
+++ b/numpy/testing/_private/nosetester.py
@@ -92,7 +92,7 @@ def run_module_suite(file_to_run=None, argv=None):
 
     Alternatively, calling::
 
-    >>> run_module_suite(file_to_run="numpy/tests/test_matlib.py")
+    >>> run_module_suite(file_to_run="numpy/tests/test_matlib.py")  # doctest: +SKIP
 
     from an interpreter will run all the test routine in 'test_matlib.py'.
     """
diff --git a/numpy/testing/_private/utils.py b/numpy/testing/_private/utils.py
index 55306e49938bfad834bd586f387f3af8c7e88db2..36f5c3cfe537bf17d695f9e120e454d652fc0cd2 100644
--- a/numpy/testing/_private/utils.py
+++ b/numpy/testing/_private/utils.py
@@ -318,8 +318,9 @@ def assert_equal(actual, desired, err_msg='', verbose=True):
     Examples
     --------
     >>> np.testing.assert_equal([4,5], [4,6])
-    ...
-    <type 'exceptions.AssertionError'>:
+    Traceback (most recent call last):
+        ...
+    AssertionError:
     Items are not equal:
     item=1
      ACTUAL: 5
@@ -510,21 +511,24 @@ def assert_almost_equal(actual,desired,decimal=7,err_msg='',verbose=True):
     >>> import numpy.testing as npt
     >>> npt.assert_almost_equal(2.3333333333333, 2.33333334)
     >>> npt.assert_almost_equal(2.3333333333333, 2.33333334, decimal=10)
-    ...
-    <type 'exceptions.AssertionError'>:
-    Items are not equal:
-     ACTUAL: 2.3333333333333002
-     DESIRED: 2.3333333399999998
+    Traceback (most recent call last):
+        ...
+    AssertionError:
+    Arrays are not almost equal to 10 decimals
+     ACTUAL: 2.3333333333333
+     DESIRED: 2.33333334
 
     >>> npt.assert_almost_equal(np.array([1.0,2.3333333333333]),
     ...                         np.array([1.0,2.33333334]), decimal=9)
-    ...
-    <type 'exceptions.AssertionError'>:
-    Arrays are not almost equal
-    <BLANKLINE>
-    (mismatch 50.0%)
-     x: array([ 1.        ,  2.33333333])
-     y: array([ 1.        ,  2.33333334])
+    Traceback (most recent call last):
+        ...
+    AssertionError:
+    Arrays are not almost equal to 9 decimals
+    Mismatch: 50%
+    Max absolute difference: 6.66669964e-09
+    Max relative difference: 2.85715698e-09
+     x: array([1.         , 2.333333333])
+     y: array([1.        , 2.33333334])
 
     """
     __tracebackhide__ = True  # Hide traceback for py.test
@@ -626,14 +630,15 @@ def assert_approx_equal(actual,desired,significant=7,err_msg='',verbose=True):
     --------
     >>> np.testing.assert_approx_equal(0.12345677777777e-20, 0.1234567e-20)
     >>> np.testing.assert_approx_equal(0.12345670e-20, 0.12345671e-20,
-                                       significant=8)
+    ...                                significant=8)
     >>> np.testing.assert_approx_equal(0.12345670e-20, 0.12345672e-20,
-                                       significant=8)
-    ...
-    <type 'exceptions.AssertionError'>:
+    ...                                significant=8)
+    Traceback (most recent call last):
+        ...
+    AssertionError:
     Items are not equal to 8 significant digits:
-     ACTUAL: 1.234567e-021
-     DESIRED: 1.2345672000000001e-021
+     ACTUAL: 1.234567e-21
+     DESIRED: 1.2345672e-21
 
     the evaluated condition that raises the exception is
 
@@ -660,10 +665,10 @@ def assert_approx_equal(actual,desired,significant=7,err_msg='',verbose=True):
         sc_actual = actual/scale
     except ZeroDivisionError:
         sc_actual = 0.0
-    msg = build_err_msg([actual, desired], err_msg,
-                header='Items are not equal to %d significant digits:' %
-                                 significant,
-                verbose=verbose)
+    msg = build_err_msg(
+        [actual, desired], err_msg,
+        header='Items are not equal to %d significant digits:' % significant,
+        verbose=verbose)
     try:
         # If one of desired/actual is not finite, handle it specially here:
         # check that both are nan if any is a nan, and test for equality
@@ -686,7 +691,7 @@ def assert_array_compare(comparison, x, y, err_msg='', verbose=True,
                          header='', precision=6, equal_nan=True,
                          equal_inf=True):
     __tracebackhide__ = True  # Hide traceback for py.test
-    from numpy.core import array, isnan, inf, bool_
+    from numpy.core import array, array2string, isnan, inf, bool_, errstate
 
     x = array(x, copy=False, subok=True)
     y = array(y, copy=False, subok=True)
@@ -782,15 +787,33 @@ def assert_array_compare(comparison, x, y, err_msg='', verbose=True,
             reduced = val.ravel()
             cond = reduced.all()
             reduced = reduced.tolist()
+
         # The below comparison is a hack to ensure that fully masked
         # results, for which val.ravel().all() returns np.ma.masked,
         # do not trigger a failure (np.ma.masked != True evaluates as
         # np.ma.masked, which is falsy).
         if cond != True:
             mismatch = 100.0 * reduced.count(0) / ox.size
-            msg = build_err_msg([ox, oy],
-                                err_msg
-                                + '\n(mismatch %s%%)' % (mismatch,),
+            remarks = ['Mismatch: {:.3g}%'.format(mismatch)]
+
+            with errstate(invalid='ignore', divide='ignore'):
+                # ignore errors for non-numeric types
+                try:
+                    error = abs(x - y)
+                    max_abs_error = error.max()
+                    remarks.append('Max absolute difference: '
+                                   + array2string(max_abs_error))
+
+                    # note: this definition of relative error matches that one
+                    # used by assert_allclose (found in np.isclose)
+                    max_rel_error = (error / abs(y)).max()
+                    remarks.append('Max relative difference: '
+                                   + array2string(max_rel_error))
+                except TypeError:
+                    pass
+
+            err_msg += '\n' + '\n'.join(remarks)
+            msg = build_err_msg([ox, oy], err_msg,
                                 verbose=verbose, header=header,
                                 names=('x', 'y'), precision=precision)
             raise AssertionError(msg)
@@ -850,14 +873,15 @@ def assert_array_equal(x, y, err_msg='', verbose=True):
 
     >>> np.testing.assert_array_equal([1.0,np.pi,np.nan],
     ...                               [1, np.sqrt(np.pi)**2, np.nan])
-    ...
-    <type 'exceptions.ValueError'>:
+    Traceback (most recent call last):
+        ...
     AssertionError:
     Arrays are not equal
-    <BLANKLINE>
-    (mismatch 50.0%)
-     x: array([ 1.        ,  3.14159265,         NaN])
-     y: array([ 1.        ,  3.14159265,         NaN])
+    Mismatch: 33.3%
+    Max absolute difference: 4.4408921e-16
+    Max relative difference: 1.41357986e-16
+     x: array([1.      , 3.141593,      nan])
+     y: array([1.      , 3.141593,      nan])
 
     Use `assert_allclose` or one of the nulp (number of floating point values)
     functions for these cases instead:
@@ -922,26 +946,29 @@ def assert_array_almost_equal(x, y, decimal=6, err_msg='', verbose=True):
     the first assert does not raise an exception
 
     >>> np.testing.assert_array_almost_equal([1.0,2.333,np.nan],
-                                             [1.0,2.333,np.nan])
+    ...                                      [1.0,2.333,np.nan])
 
     >>> np.testing.assert_array_almost_equal([1.0,2.33333,np.nan],
     ...                                      [1.0,2.33339,np.nan], decimal=5)
-    ...
-    <type 'exceptions.AssertionError'>:
+    Traceback (most recent call last):
+        ...
     AssertionError:
-    Arrays are not almost equal
-    <BLANKLINE>
-    (mismatch 50.0%)
-     x: array([ 1.     ,  2.33333,      NaN])
-     y: array([ 1.     ,  2.33339,      NaN])
+    Arrays are not almost equal to 5 decimals
+    Mismatch: 33.3%
+    Max absolute difference: 6.e-05
+    Max relative difference: 2.57136612e-05
+     x: array([1.     , 2.33333,     nan])
+     y: array([1.     , 2.33339,     nan])
 
     >>> np.testing.assert_array_almost_equal([1.0,2.33333,np.nan],
     ...                                      [1.0,2.33333, 5], decimal=5)
-    <type 'exceptions.ValueError'>:
-    ValueError:
-    Arrays are not almost equal
-     x: array([ 1.     ,  2.33333,      NaN])
-     y: array([ 1.     ,  2.33333,  5.     ])
+    Traceback (most recent call last):
+        ...
+    AssertionError:
+    Arrays are not almost equal to 5 decimals
+    x and y nan location mismatch:
+     x: array([1.     , 2.33333,     nan])
+     y: array([1.     , 2.33333, 5.     ])
 
     """
     __tracebackhide__ = True  # Hide traceback for py.test
@@ -1022,27 +1049,34 @@ def assert_array_less(x, y, err_msg='', verbose=True):
     --------
     >>> np.testing.assert_array_less([1.0, 1.0, np.nan], [1.1, 2.0, np.nan])
     >>> np.testing.assert_array_less([1.0, 1.0, np.nan], [1, 2.0, np.nan])
-    ...
-    <type 'exceptions.ValueError'>:
+    Traceback (most recent call last):
+        ...
+    AssertionError:
     Arrays are not less-ordered
-    (mismatch 50.0%)
-     x: array([  1.,   1.,  NaN])
-     y: array([  1.,   2.,  NaN])
+    Mismatch: 33.3%
+    Max absolute difference: 1.
+    Max relative difference: 0.5
+     x: array([ 1.,  1., nan])
+     y: array([ 1.,  2., nan])
 
     >>> np.testing.assert_array_less([1.0, 4.0], 3)
-    ...
-    <type 'exceptions.ValueError'>:
+    Traceback (most recent call last):
+        ...
+    AssertionError:
     Arrays are not less-ordered
-    (mismatch 50.0%)
-     x: array([ 1.,  4.])
+    Mismatch: 50%
+    Max absolute difference: 2.
+    Max relative difference: 0.66666667
+     x: array([1., 4.])
      y: array(3)
 
     >>> np.testing.assert_array_less([1.0, 2.0, 3.0], [4])
-    ...
-    <type 'exceptions.ValueError'>:
+    Traceback (most recent call last):
+        ...
+    AssertionError:
     Arrays are not less-ordered
     (shapes (3,), (1,) mismatch)
-     x: array([ 1.,  2.,  3.])
+     x: array([1., 2., 3.])
      y: array([4])
 
     """
@@ -1147,7 +1181,7 @@ def rundocs(filename=None, raise_on_error=True):
     argument to the ``test()`` call. For example, to run all tests (including
     doctests) for `numpy.lib`:
 
-    >>> np.lib.test(doctests=True) #doctest: +SKIP
+    >>> np.lib.test(doctests=True)  # doctest: +SKIP
     """
     from numpy.compat import npy_load_module
     import doctest
@@ -1329,7 +1363,7 @@ def decorate_methods(cls, decorator, testmatch=None):
     return
 
 
-def measure(code_str,times=1,label=None):
+def measure(code_str, times=1, label=None):
     """
     Return elapsed time for executing code in the namespace of the caller.
 
@@ -1356,9 +1390,9 @@ def measure(code_str,times=1,label=None):
 
     Examples
     --------
-    >>> etime = np.testing.measure('for i in range(1000): np.sqrt(i**2)',
-    ...                            times=times)
-    >>> print("Time for a single execution : ", etime / times, "s")
+    >>> times = 10
+    >>> etime = np.testing.measure('for i in range(1000): np.sqrt(i**2)', times=times)
+    >>> print("Time for a single execution : ", etime / times, "s")  # doctest: +SKIP
     Time for a single execution :  0.005 s
 
     """
@@ -1443,7 +1477,7 @@ def assert_allclose(actual, desired, rtol=1e-7, atol=0, equal_nan=True,
     --------
     >>> x = [1e-5, 1e-3, 1e-1]
     >>> y = np.arccos(np.cos(x))
-    >>> assert_allclose(x, y, rtol=1e-5, atol=0)
+    >>> np.testing.assert_allclose(x, y, rtol=1e-5, atol=0)
 
     """
     __tracebackhide__ = True  # Hide traceback for py.test
@@ -1897,7 +1931,8 @@ class clear_and_catch_warnings(warnings.catch_warnings):
     Examples
     --------
     >>> import warnings
-    >>> with clear_and_catch_warnings(modules=[np.core.fromnumeric]):
+    >>> with np.testing.clear_and_catch_warnings(
+    ...         modules=[np.core.fromnumeric]):
     ...     warnings.simplefilter('always')
     ...     warnings.filterwarnings('ignore', module='np.core.fromnumeric')
     ...     # do something that raises a warning but ignore those in
@@ -1978,25 +2013,28 @@ class suppress_warnings(object):
 
     Examples
     --------
-    >>> with suppress_warnings() as sup:
-    ...     sup.filter(DeprecationWarning, "Some text")
-    ...     sup.filter(module=np.ma.core)
-    ...     log = sup.record(FutureWarning, "Does this occur?")
-    ...     command_giving_warnings()
-    ...     # The FutureWarning was given once, the filtered warnings were
-    ...     # ignored. All other warnings abide outside settings (may be
-    ...     # printed/error)
-    ...     assert_(len(log) == 1)
-    ...     assert_(len(sup.log) == 1)  # also stored in log attribute
-
-    Or as a decorator:
-
-    >>> sup = suppress_warnings()
-    >>> sup.filter(module=np.ma.core)  # module must match exact
-    >>> @sup
-    >>> def some_function():
-    ...     # do something which causes a warning in np.ma.core
-    ...     pass
+
+    With a context manager::
+
+        with np.testing.suppress_warnings() as sup:
+            sup.filter(DeprecationWarning, "Some text")
+            sup.filter(module=np.ma.core)
+            log = sup.record(FutureWarning, "Does this occur?")
+            command_giving_warnings()
+            # The FutureWarning was given once, the filtered warnings were
+            # ignored. All other warnings abide outside settings (may be
+            # printed/error)
+            assert_(len(log) == 1)
+            assert_(len(sup.log) == 1)  # also stored in log attribute
+
+    Or as a decorator::
+
+        sup = np.testing.suppress_warnings()
+        sup.filter(module=np.ma.core)  # module must match exactly
+        @sup
+        def some_function():
+            # do something which causes a warning in np.ma.core
+            pass
     """
     def __init__(self, forwarding_rule="always"):
         self._entered = False
diff --git a/numpy/testing/tests/test_utils.py b/numpy/testing/tests/test_utils.py
index 43afafaa8afecb1ca44a9e33182dc409627d9d4c..c376a3852b3ecb2e40c38e8a167fc66dc4226256 100644
--- a/numpy/testing/tests/test_utils.py
+++ b/numpy/testing/tests/test_utils.py
@@ -327,24 +327,22 @@ class TestEqual(TestArrayEqual):
         self._test_not_equal(x, y)
 
     def test_error_message(self):
-        try:
+        with pytest.raises(AssertionError) as exc_info:
             self._assert_func(np.array([1, 2]), np.array([[1, 2]]))
-        except AssertionError as e:
-            msg = str(e)
-            msg2 = msg.replace("shapes (2L,), (1L, 2L)", "shapes (2,), (1, 2)")
-            msg_reference = textwrap.dedent("""\
+        msg = str(exc_info.value)
+        msg2 = msg.replace("shapes (2L,), (1L, 2L)", "shapes (2,), (1, 2)")
+        msg_reference = textwrap.dedent("""\
 
-            Arrays are not equal
+        Arrays are not equal
 
-            (shapes (2,), (1, 2) mismatch)
-             x: array([1, 2])
-             y: array([[1, 2]])""")
-            try:
-                assert_equal(msg, msg_reference)
-            except AssertionError:
-                assert_equal(msg2, msg_reference)
-        else:
-            raise AssertionError("Did not raise")
+        (shapes (2,), (1, 2) mismatch)
+         x: array([1, 2])
+         y: array([[1, 2]])""")
+
+        try:
+            assert_equal(msg, msg_reference)
+        except AssertionError:
+            assert_equal(msg2, msg_reference)
 
 
 class TestArrayAlmostEqual(_GenericTest):
@@ -509,38 +507,53 @@ class TestAlmostEqual(_GenericTest):
         x = np.array([1.00000000001, 2.00000000002, 3.00003])
         y = np.array([1.00000000002, 2.00000000003, 3.00004])
 
-        # test with a different amount of decimal digits
-        # note that we only check for the formatting of the arrays themselves
-        b = ('x: array([1.00000000001, 2.00000000002, 3.00003     '
-             ' ])\n y: array([1.00000000002, 2.00000000003, 3.00004      ])')
-        try:
+        # Test with a different amount of decimal digits
+        with pytest.raises(AssertionError) as exc_info:
             self._assert_func(x, y, decimal=12)
-        except AssertionError as e:
-            # remove anything that's not the array string
-            assert_equal(str(e).split('%)\n ')[1], b)
-
-        # with the default value of decimal digits, only the 3rd element differs
-        # note that we only check for the formatting of the arrays themselves
-        b = ('x: array([1.     , 2.     , 3.00003])\n y: array([1.     , '
-             '2.     , 3.00004])')
-        try:
+        msgs = str(exc_info.value).split('\n')
+        assert_equal(msgs[3], 'Mismatch: 100%')
+        assert_equal(msgs[4], 'Max absolute difference: 1.e-05')
+        assert_equal(msgs[5], 'Max relative difference: 3.33328889e-06')
+        assert_equal(
+            msgs[6],
+            ' x: array([1.00000000001, 2.00000000002, 3.00003      ])')
+        assert_equal(
+            msgs[7],
+            ' y: array([1.00000000002, 2.00000000003, 3.00004      ])')
+
+        # With the default value of decimal digits, only the 3rd element
+        # differs. Note that we only check for the formatting of the arrays
+        # themselves.
+        with pytest.raises(AssertionError) as exc_info:
             self._assert_func(x, y)
-        except AssertionError as e:
-            # remove anything that's not the array string
-            assert_equal(str(e).split('%)\n ')[1], b)
-
-        # Check the error message when input includes inf or nan
+        msgs = str(exc_info.value).split('\n')
+        assert_equal(msgs[3], 'Mismatch: 33.3%')
+        assert_equal(msgs[4], 'Max absolute difference: 1.e-05')
+        assert_equal(msgs[5], 'Max relative difference: 3.33328889e-06')
+        assert_equal(msgs[6], ' x: array([1.     , 2.     , 3.00003])')
+        assert_equal(msgs[7], ' y: array([1.     , 2.     , 3.00004])')
+
+        # Check the error message when input includes inf
         x = np.array([np.inf, 0])
         y = np.array([np.inf, 1])
-        try:
+        with pytest.raises(AssertionError) as exc_info:
+            self._assert_func(x, y)
+        msgs = str(exc_info.value).split('\n')
+        assert_equal(msgs[3], 'Mismatch: 50%')
+        assert_equal(msgs[4], 'Max absolute difference: 1.')
+        assert_equal(msgs[5], 'Max relative difference: 1.')
+        assert_equal(msgs[6], ' x: array([inf,  0.])')
+        assert_equal(msgs[7], ' y: array([inf,  1.])')
+
+        # Check the error message when dividing by zero
+        x = np.array([1, 2])
+        y = np.array([0, 0])
+        with pytest.raises(AssertionError) as exc_info:
             self._assert_func(x, y)
-        except AssertionError as e:
-            msgs = str(e).split('\n')
-            # assert error percentage is 50%
-            assert_equal(msgs[3], '(mismatch 50.0%)')
-            # assert output array contains inf
-            assert_equal(msgs[4], ' x: array([inf,  0.])')
-            assert_equal(msgs[5], ' y: array([inf,  1.])')
+        msgs = str(exc_info.value).split('\n')
+        assert_equal(msgs[3], 'Mismatch: 100%')
+        assert_equal(msgs[4], 'Max absolute difference: 2')
+        assert_equal(msgs[5], 'Max relative difference: inf')
 
     def test_subclass_that_cannot_be_bool(self):
         # While we cannot guarantee testing functions will always work for
@@ -829,12 +842,12 @@ class TestAssertAllclose(object):
     def test_report_fail_percentage(self):
         a = np.array([1, 1, 1, 1])
         b = np.array([1, 1, 1, 2])
-        try:
+
+        with pytest.raises(AssertionError) as exc_info:
             assert_allclose(a, b)
-            msg = ''
-        except AssertionError as exc:
-            msg = exc.args[0]
-        assert_("mismatch 25.0%" in msg)
+        msg = str(exc_info.value)
+        assert_('Mismatch: 25%\nMax absolute difference: 1\n'
+                'Max relative difference: 0.5' in msg)
 
     def test_equal_nan(self):
         a = np.array([np.nan])
@@ -1117,12 +1130,10 @@ class TestStringEqual(object):
         assert_string_equal("hello", "hello")
         assert_string_equal("hello\nmultiline", "hello\nmultiline")
 
-        try:
+        with pytest.raises(AssertionError) as exc_info:
             assert_string_equal("foo\nbar", "hello\nbar")
-        except AssertionError as exc:
-            assert_equal(str(exc), "Differences in strings:\n- foo\n+ hello")
-        else:
-            raise AssertionError("exception not raised")
+        msg = str(exc_info.value)
+        assert_equal(msg, "Differences in strings:\n- foo\n+ hello")
 
         assert_raises(AssertionError,
                       lambda: assert_string_equal("foo", "hello"))
diff --git a/numpy/tests/test_ctypeslib.py b/numpy/tests/test_ctypeslib.py
index d389b37a876043d8bce19bab1b5a7d7fe17b1fde..521208c36d3d20f62fd41cbff0e55c41eb6b9820 100644
--- a/numpy/tests/test_ctypeslib.py
+++ b/numpy/tests/test_ctypeslib.py
@@ -273,3 +273,95 @@ class TestAsArray(object):
 
         # check we avoid the segfault
         c_arr[0][0][0]
+
+
+@pytest.mark.skipif(ctypes is None,
+                    reason="ctypes not available on this python installation")
+class TestAsCtypesType(object):
+    """ Test conversion from dtypes to ctypes types """
+    def test_scalar(self):
+        dt = np.dtype('<u2')
+        ct = np.ctypeslib.as_ctypes_type(dt)
+        assert_equal(ct, ctypes.c_uint16.__ctype_le__)
+
+        dt = np.dtype('>u2')
+        ct = np.ctypeslib.as_ctypes_type(dt)
+        assert_equal(ct, ctypes.c_uint16.__ctype_be__)
+
+        dt = np.dtype('u2')
+        ct = np.ctypeslib.as_ctypes_type(dt)
+        assert_equal(ct, ctypes.c_uint16)
+
+    def test_subarray(self):
+        dt = np.dtype((np.int32, (2, 3)))
+        ct = np.ctypeslib.as_ctypes_type(dt)
+        assert_equal(ct, 2 * (3 * ctypes.c_int32))
+
+    def test_structure(self):
+        dt = np.dtype([
+            ('a', np.uint16),
+            ('b', np.uint32),
+        ])
+
+        ct = np.ctypeslib.as_ctypes_type(dt)
+        assert_(issubclass(ct, ctypes.Structure))
+        assert_equal(ctypes.sizeof(ct), dt.itemsize)
+        assert_equal(ct._fields_, [
+            ('a', ctypes.c_uint16),
+            ('b', ctypes.c_uint32),
+        ])
+
+    def test_structure_aligned(self):
+        dt = np.dtype([
+            ('a', np.uint16),
+            ('b', np.uint32),
+        ], align=True)
+
+        ct = np.ctypeslib.as_ctypes_type(dt)
+        assert_(issubclass(ct, ctypes.Structure))
+        assert_equal(ctypes.sizeof(ct), dt.itemsize)
+        assert_equal(ct._fields_, [
+            ('a', ctypes.c_uint16),
+            ('', ctypes.c_char * 2),  # padding
+            ('b', ctypes.c_uint32),
+        ])
+
+    def test_union(self):
+        dt = np.dtype(dict(
+            names=['a', 'b'],
+            offsets=[0, 0],
+            formats=[np.uint16, np.uint32]
+        ))
+
+        ct = np.ctypeslib.as_ctypes_type(dt)
+        assert_(issubclass(ct, ctypes.Union))
+        assert_equal(ctypes.sizeof(ct), dt.itemsize)
+        assert_equal(ct._fields_, [
+            ('a', ctypes.c_uint16),
+            ('b', ctypes.c_uint32),
+        ])
+
+    def test_padded_union(self):
+        dt = np.dtype(dict(
+            names=['a', 'b'],
+            offsets=[0, 0],
+            formats=[np.uint16, np.uint32],
+            itemsize=5,
+        ))
+
+        ct = np.ctypeslib.as_ctypes_type(dt)
+        assert_(issubclass(ct, ctypes.Union))
+        assert_equal(ctypes.sizeof(ct), dt.itemsize)
+        assert_equal(ct._fields_, [
+            ('a', ctypes.c_uint16),
+            ('b', ctypes.c_uint32),
+            ('', ctypes.c_char * 5),  # padding
+        ])
+
+    def test_overlapping(self):
+        dt = np.dtype(dict(
+            names=['a', 'b'],
+            offsets=[0, 2],
+            formats=[np.uint32, np.uint32]
+        ))
+        assert_raises(NotImplementedError, np.ctypeslib.as_ctypes_type, dt)
diff --git a/numpy/tests/test_scripts.py b/numpy/tests/test_scripts.py
index 9e27cc6cebc68aa075b7c1f3ff0507898706cf49..e42dc25f98e93eb1a28bc53e7d1c23de71a39992 100644
--- a/numpy/tests/test_scripts.py
+++ b/numpy/tests/test_scripts.py
@@ -8,7 +8,7 @@ import sys
 import os
 import pytest
 from os.path import join as pathjoin, isfile, dirname
-from subprocess import Popen, PIPE
+import subprocess
 
 import numpy as np
 from numpy.compat.py3k import basestring
@@ -17,74 +17,13 @@ from numpy.testing import assert_, assert_equal
 is_inplace = isfile(pathjoin(dirname(np.__file__),  '..', 'setup.py'))
 
 
-def run_command(cmd, check_code=True):
-    """ Run command sequence `cmd` returning exit code, stdout, stderr
-
-    Parameters
-    ----------
-    cmd : str or sequence
-        string with command name or sequence of strings defining command
-    check_code : {True, False}, optional
-        If True, raise error for non-zero return code
-
-    Returns
-    -------
-    returncode : int
-        return code from execution of `cmd`
-    stdout : bytes (python 3) or str (python 2)
-        stdout from `cmd`
-    stderr : bytes (python 3) or str (python 2)
-        stderr from `cmd`
-
-    Raises
-    ------
-    RuntimeError
-        If `check_code` is True, and return code !=0
-    """
-    cmd = [cmd] if isinstance(cmd, basestring) else list(cmd)
-    if os.name == 'nt':
-        # Quote any arguments with spaces. The quotes delimit the arguments
-        # on Windows, and the arguments might be file paths with spaces.
-        # On Unix the list elements are each separate arguments.
-        cmd = ['"{0}"'.format(c) if ' ' in c else c for c in cmd]
-    proc = Popen(cmd, stdout=PIPE, stderr=PIPE)
-    stdout, stderr = proc.communicate()
-    if proc.poll() is None:
-        proc.terminate()
-    if check_code and proc.returncode != 0:
-        raise RuntimeError('\n'.join(
-            ['Command "{0}" failed with',
-             'stdout', '------', '{1}', '',
-             'stderr', '------', '{2}']).format(cmd, stdout, stderr))
-    return proc.returncode, stdout, stderr
-
-
-@pytest.mark.skipif(is_inplace, reason="Cannot test f2py command inplace")
-@pytest.mark.xfail(reason="Test is unreliable")
-def test_f2py():
-    # test that we can run f2py script
-
-    def try_f2py_commands(cmds):
-        success = 0
-        for f2py_cmd in cmds:
-            try:
-                code, stdout, stderr = run_command([f2py_cmd, '-v'])
-                assert_equal(stdout.strip(), b'2')
-                success += 1
-            except Exception:
-                pass
-        return success
-
+def find_f2py_commands():
     if sys.platform == 'win32':
-        # Only the single 'f2py' script is installed in windows.
         exe_dir = dirname(sys.executable)
         if exe_dir.endswith('Scripts'): # virtualenv
-            f2py_cmds = [os.path.join(exe_dir, 'f2py')]
+            return [os.path.join(exe_dir, 'f2py')]
         else:
-            f2py_cmds = [os.path.join(exe_dir, "Scripts", 'f2py')]
-        success = try_f2py_commands(f2py_cmds)
-        msg = "Warning: f2py not found in path"
-        assert_(success == 1, msg)
+            return [os.path.join(exe_dir, "Scripts", 'f2py')]
     else:
         # Three scripts are installed in Unix-like systems:
         # 'f2py', 'f2py{major}', and 'f2py{major.minor}'. For example,
@@ -93,7 +32,18 @@ def test_f2py():
         version = sys.version_info
         major = str(version.major)
         minor = str(version.minor)
-        f2py_cmds = ('f2py', 'f2py' + major, 'f2py' + major + '.' + minor)
-        success = try_f2py_commands(f2py_cmds)
-        msg = "Warning: not all of %s, %s, and %s are found in path" % f2py_cmds
-        assert_(success == 3, msg)
+        return ['f2py', 'f2py' + major, 'f2py' + major + '.' + minor]
+
+
+@pytest.mark.skipif(is_inplace, reason="Cannot test f2py command inplace")
+@pytest.mark.xfail(reason="Test is unreliable")
+@pytest.mark.parametrize('f2py_cmd', find_f2py_commands())
+def test_f2py(f2py_cmd):
+    # test that we can run f2py script
+    stdout = subprocess.check_output([f2py_cmd, '-v'])
+    assert_equal(stdout.strip(), b'2')
+
+
+def test_pep338():
+    stdout = subprocess.check_output([sys.executable, '-mnumpy.f2py', '-v'])
+    assert_equal(stdout.strip(), b'2')
diff --git a/numpy/version.py b/numpy/version.py
index 0ad5dad1fde5f21c7516c529ccdd0ff2f8f501cc..7bea2a55588598c8f6a4907b32beaa29b9d21cf8 100644
--- a/numpy/version.py
+++ b/numpy/version.py
@@ -2,10 +2,10 @@
 # THIS FILE IS GENERATED FROM NUMPY SETUP.PY
 #
 # To compare versions robustly, use `numpy.lib.NumpyVersion`
-short_version = '1.16.0'
-version = '1.16.0'
-full_version = '1.16.0'
-git_revision = '971e2e89d08deeae0139d3011d15646fdac13c92'
+short_version = '1.16.1'
+version = '1.16.1'
+full_version = '1.16.1'
+git_revision = '685b9ace06f1dc50e2698099d7a2b6a241379318'
 release = True
 
 if not release:
diff --git a/setup.py b/setup.py
index 12d3010b37394c8e3b9a64c744e1054d1d22f2ec..c61afa20e228726e26c380a72ced25199c99073c 100755
--- a/setup.py
+++ b/setup.py
@@ -61,7 +61,7 @@ Operating System :: MacOS
 
 MAJOR               = 1
 MINOR               = 16
-MICRO               = 0
+MICRO               = 1
 ISRELEASED          = True
 VERSION             = '%d.%d.%d' % (MAJOR, MINOR, MICRO)
 
diff --git a/tools/travis-test.sh b/tools/travis-test.sh
index fa83606b225d7e4ad8234b77d6c171eaa01de750..bdbbd8024526d14014169dbaae11cd68e9a9766e 100755
--- a/tools/travis-test.sh
+++ b/tools/travis-test.sh
@@ -113,7 +113,7 @@ run_test()
 
   if [ -n "$RUN_COVERAGE" ]; then
     $PIP install pytest-cov
-    NUMPY_EXPERIMENTAL_ARRAY_FUNCTION=1
+    export NUMPY_EXPERIMENTAL_ARRAY_FUNCTION=1
     COVERAGE_FLAG=--coverage
   fi