<commit_before>Cauchy Random Numbers
===

> [Cauchy][cauchy] distributed pseudorandom numbers.


<!-- <usage> -->

## Usage

``` javascript
var rcauchy = require( '@stdlib/math/base/random/cauchy' );
```

#### rcauchy( x0, gamma )

Returns a pseudorandom number drawn from a [Cauchy][cauchy] distribution with parameters `x0`(location parameter) and `gamma > 0`(scale parameter).

``` javascript
var r = rcauchy( 2.0, 5.0 );
// returns <number>
```

If provided `gamma <= 0`, the function throws an error.

``` javascript
var r = rcauchy( 1.0, -1.0 );
// throws TypeError
```

#### rcauchy.factory( \[x0, gamma, \]\[options\] )

Returns a pseudorandom number generator (PRNG) for generating pseudorandom numbers drawn from a [Cauchy][cauchy] distribution. If `x0`(location parameter) and `gamma`(scale parameter) are supplied, the returned generator returns random variates from the specified distribution, otherwise the parameters have to be supplied at each generator invocation.

``` javascript
// Draw from Cauchy( 0.0, 1.5 ) distribution:
var rand = rcauchy.factory();
var r = rand( 0.0, 1.5 );
// returns <number>

// Draw from Cauchy( 0.0, 1.5 ) distribution:
rand = rcauchy.factory( 0.0, 1.5 );
r = rand();
// returns <number>
```

The function accepts the following `options`:

* __seed__: pseudorandom number generator seed.

To seed a pseudorandom number generator, set the `seed` option.

``` javascript
var rand = rcauchy.factory({
    'seed': 12345
});

var r = rand( 2.0, 3.0 );
// returns <number>

rand = rcauchy.factory( 1.0, 2.0, {
    'seed': 12345
});

r = rand();
// returns <number>
```

#### rcauchy.NAME

The generator name.

``` javascript
var name = rcauchy.NAME;
// returns 'cauchy'
```

#### rcauchy.SEED

The value used to seed `rcauchy()`.

``` javascript
var rand;
var r;
var i;

// Generate pseudorandom values...
for ( i = 0; i < 100; i++ ) {
    r = rcauchy( 0.0, 2.0 );
}

// Generate the same pseudorandom values...
rand = rcauchy.factory( 0.0, 2.0, {
    'seed': rcauchy.SEED
});
for ( i = 0; i < 100; i++ ) {
    r = rand();
}
```

<!-- </usage> -->

<!-- <examples> -->

## Examples

``` javascript
var rcauchy = require( '@stdlib/math/base/random/beta' );

var seed;
var rand;
var i;

// Generate pseudorandom numbers...
console.log( '\nseed: %d', rcauchy.SEED );
for ( i = 0; i < 100; i++ ) {
	console.log( rcauchy( 2.0, 2.0 ) );
}

// Create a new pseudorandom number generator...
seed = 1234;
rand = rcauchy.factory( -6.0, 2.0, {
	'seed': seed
});
console.log( '\nseed: %d', seed );
for ( i = 0; i < 100; i++ ) {
	console.log( rand() );
}

// Create another pseudorandom number generator using a previous seed...
rand = rcauchy.factory( 2.0, 2.0, {
	'seed': rcauchy.SEED
});
console.log( '\nseed: %d', rcauchy.SEED );
for ( i = 0; i < 100; i++ ) {
	console.log( rand() );
}
```

<!-- </examples> -->


<!-- <links> -->

[cauchy]: https://en.wikipedia.org/wiki/Cauchy_distribution

<!-- </links> --><commit_msg>Fix REAMDE.md errors<commit_after>Cauchy Random Numbers
===

> [Cauchy][cauchy] distributed pseudorandom numbers.


<!-- <usage> -->

## Usage

``` javascript
var rcauchy = require( '@stdlib/math/base/random/cauchy' );
```

#### rcauchy( x0, gamma )

Returns a pseudorandom number drawn from a [Cauchy][cauchy] distribution with parameters `x0`(location parameter) and `gamma > 0`(scale parameter).

``` javascript
var r = rcauchy( 2.0, 5.0 );
// returns <number>
```

If provided `gamma <= 0`, the function throws an error.

``` javascript
var r = rcauchy( 1.0, 0.0 );
// throws TypeError

r = rcauchy( 1.0, -1.0 );
// throws TypeError
```

#### rcauchy.factory( \[x0, gamma, \]\[options\] )

Returns a pseudorandom number generator (PRNG) for generating pseudorandom numbers drawn from a [Cauchy][cauchy] distribution. If `x0`(location parameter) and `gamma > 0`(scale parameter) are supplied, the returned generator returns random variates from the specified distribution, otherwise the parameters have to be supplied at each generator invocation.

``` javascript
// Draw from Cauchy( 0.0, 1.5 ) distribution:
var rand = rcauchy.factory();
var r = rand( 0.0, 1.5 );
// returns <number>

// Draw from Cauchy( 0.0, 1.5 ) distribution:
rand = rcauchy.factory( 0.0, 1.5 );
r = rand();
// returns <number>
```

The function accepts the following `options`:

* __seed__: pseudorandom number generator seed.

To seed a pseudorandom number generator, set the `seed` option.

``` javascript
var rand = rcauchy.factory({
    'seed': 12345
});

var r = rand( 2.0, 3.0 );
// returns <number>

rand = rcauchy.factory( 2.0, 3.0, {
    'seed': 12345
});

r = rand();
// returns <number>
```

#### rcauchy.NAME

The generator name.

``` javascript
var name = rcauchy.NAME;
// returns 'cauchy'
```

#### rcauchy.SEED

The value used to seed `rcauchy()`.

``` javascript
var rand;
var r;
var i;

// Generate pseudorandom values...
for ( i = 0; i < 100; i++ ) {
    r = rcauchy( 0.0, 2.0 );
}

// Generate the same pseudorandom values...
rand = rcauchy.factory( 0.0, 2.0, {
    'seed': rcauchy.SEED
});
for ( i = 0; i < 100; i++ ) {
    r = rand();
}
```

<!-- </usage> -->

<!-- <examples> -->

## Examples

``` javascript
var rcauchy = require( '@stdlib/math/base/random/cauchy' );

var seed;
var rand;
var i;

// Generate pseudorandom numbers...
console.log( '\nseed: %d', rcauchy.SEED );
for ( i = 0; i < 100; i++ ) {
    console.log( rcauchy( 2.0, 2.0 ) );
}

// Create a new pseudorandom number generator...
seed = 1234;
rand = rcauchy.factory( -6.0, 2.0, {
    'seed': seed
});
console.log( '\nseed: %d', seed );
for ( i = 0; i < 100; i++ ) {
    console.log( rand() );
}

// Create another pseudorandom number generator using a previous seed...
rand = rcauchy.factory( 2.0, 2.0, {
    'seed': rcauchy.SEED
});
console.log( '\nseed: %d', rcauchy.SEED );
for ( i = 0; i < 100; i++ ) {
    console.log( rand() );
}
```

<!-- </examples> -->


<!-- <links> -->

[cauchy]: https://en.wikipedia.org/wiki/Cauchy_distribution

<!-- </links> -->
{'fraction_non_alphanumeric': 0.18639251086593112, 'fraction_numerical': 0.03159478435305918, 'mean_word_length': 3.338651196519217, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 42, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3137056', 'n_tokens_mistral': 2333, 'n_tokens_neox': 2096, 'n_words': 663}