# -*- coding: utf-8 -*-
__all__ = ["randh", "wrap"]

import numpy as np
import numpy.random as rng

def randh():
    """
    Generate from the heavy-tailed distribution.
    """
    return 10.0**(1.5 - 3*np.abs(rng.randn()/np.sqrt(-np.log(rng.rand()))))*rng.randn()

def wrap(x, a, b):
    assert b > a
    return (x - a)%(b - a) + a


@@ -103,19 +103,22 @@
 f randh(
+N=1
 ):%0A
-
     %22%22%22%0A
@@ -170,24 +170,38 @@
 on.%0A    %22%22%22%0A
+    if N==1:%0A%09
     return 1
@@ -276,16 +276,108 @@
 randn()%0A
+    return 10.0**(1.5 - 3*np.abs(rng.randn(N)/np.sqrt(-np.log(rng.rand(N)))))*rng.randn(N)%0A%0A
 %0Adef wra

Allow N > 1 randhs to be generated