## NAME

shufrans - random number shufflers

## SYNOPSIS

cc [ __flag__ ... ] __file__ ... -lsunmath -lm [ __library__ ... ]
#include <sunmath.h>
void i_shufrans_(int *__x__, int *__n__, int *__l__, int *__u__);
void u_shufrans_(unsigned *__x__, int *__n__, unsigned *__l__, unsigned
*__u__);
void r_shufrans_(float *__x__, int *__n__, float *__l__, float *__u__);
void d_shufrans_(double *__x__, int *__n__, double *__l__, double *__u__);

## DESCRIPTION

These functions shuffle the random numbers __x__[0], ...,
__x__[*__n__-1] in place. The numbers may have been generated by
any method but are assumed to be uniformly distributed over
the interval [*__l__,*__u__]. (If any number lies outside this
interval, the results are undefined.)
These routines use the method called "Algorithm B" by Knuth.
They use an internal table of between 4 and 256 elements
depending on *__n__.

## EXAMPLES

To shuffle 1000 double precision random numbers in [__lb__, __ub__]:
double x[1000], lb, ub;
int n = 1000;
d_shufrans_(x, &n, &lb, &ub);

## SEE ALSO

**addrans(3M)**, **drand48(3C)**, **lcrans(3M)**, **mwcrans(3M)**, **rand(3C)**,
**random(3C)**.
Knuth, __Seminumerical__ __Algorithms__, 1981, Addison-Wesley.
Park and Miller, __Random__ __Number__ __Generators__: __Good__ __Ones__ __are__
__Hard__ __to__ __Find__, Communications of the ACM, October 1988.