Skip to content

Commit 50d36ab

Browse files
committed
ENH: Add additional 32-bit floating point output
Add 32-bit float support for exponentials Refactor distribution.c to avoid code duplication Refactor ziggurat constants to separate header Use better names for _double and _float core RNG
1 parent 6d397d8 commit 50d36ab

File tree

7 files changed

+466
-409
lines changed

7 files changed

+466
-409
lines changed

README.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,33 @@ same seed, same random numbers).
2323
* Support for random number generators that support independent streams
2424
and jumping ahead so that substreams can be generated
2525
* Faster random number generation, especially for Normals using the
26-
Ziggurat method
26+
Ziggurat method
2727

2828
```python
2929
import randomstate as rnd
3030
w = rnd.standard_normal(10000, method='zig')
3131
```
3232

33+
* Preliminary support for 32-bit floating randoms for core generators.
34+
Currently only uniforms (`random_sample`) and exponentials
35+
(`standard_exponential`) have been implemented. Ultimately support
36+
should be avialable for:
37+
38+
* Uniforms
39+
* Exponentials
40+
* Standard Gammas (via `standard_gamma`)
41+
* Normals (via `standard_normal`)
42+
43+
**WARNING**: The 32-bit generators are **experimental** and subjust
44+
to change.
45+
46+
**Note**: There are no plans to extend the alternative precision generation to
47+
all random number types.
48+
49+
50+
51+
52+
3353
## Included Pseudo Random Number Generators
3454

3555
This modules includes a number of alternative random

README.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,22 @@ Features
3131
import randomstate as rnd
3232
w = rnd.standard_normal(10000, method='zig')
3333
34+
- Preliminary support for 32-bit floating randoms for core generators.
35+
Currently only uniforms (``random_sample``) and exponentials
36+
(``standard_exponential``) have been implemented. Ultimately support
37+
should be avialable for:
38+
39+
- Uniforms
40+
- Exponentials
41+
- Standard Gammas (via ``standard_gamma``)
42+
- Normals (via ``standard_normal``)
43+
44+
**WARNING**: The 32-bit generators are **experimental** and subjust to
45+
change.
46+
47+
**Note**: There are no plans to extend the alternative precision
48+
generation to all random number types.
49+
3450
Included Pseudo Random Number Generators
3551
----------------------------------------
3652

@@ -61,6 +77,9 @@ New Features
6177
argument which can be ``bm`` or ``zig`` where ``bm`` corresponds to
6278
the current method using the Box-Muller transformation and ``zig``
6379
uses the much faster (100%+) ziggurat method.
80+
- ``random_sample`` can produce either single precision
81+
(``np.float32``) or double precision (``np.float64``, the default)
82+
using an the optional keyword argument ``dtype``.
6483

6584
New Functions
6685
~~~~~~~~~~~~~

0 commit comments

Comments
 (0)