{"id":19018925,"url":"https://github.com/stdlib-js/random-streams-box-muller","last_synced_at":"2025-05-12T17:27:33.397Z","repository":{"id":41454113,"uuid":"377257526","full_name":"stdlib-js/random-streams-box-muller","owner":"stdlib-js","description":"Create a readable stream for generating pseudorandom numbers drawn from a standard normal distribution using the Box-Muller transform.","archived":false,"fork":false,"pushed_at":"2025-04-07T00:46:21.000Z","size":3774,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-12T23:27:04.793Z","etag":null,"topics":["bell","continuous","gaussian","generator","javascript","math","mathematics","node","node-js","nodejs","normal","prng","pseudorandom","rand","random","rng","standard","statistics","stats","stdlib"],"latest_commit_sha":null,"homepage":"https://github.com/stdlib-js/stdlib","language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stdlib-js.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["stdlib-js"],"open_collective":"stdlib","tidelift":"npm/@stdlib/stdlib"}},"created_at":"2021-06-15T18:21:19.000Z","updated_at":"2025-04-07T00:37:00.000Z","dependencies_parsed_at":"2023-02-17T04:25:20.814Z","dependency_job_id":"af2ed527-f69e-479b-8d0f-236e94b29b70","html_url":"https://github.com/stdlib-js/random-streams-box-muller","commit_stats":{"total_commits":42,"total_committers":1,"mean_commits":42.0,"dds":0.0,"last_synced_commit":"41f89d04dbf378e3964c613cf6ad027fa8579870"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stdlib-js%2Frandom-streams-box-muller","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stdlib-js%2Frandom-streams-box-muller/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stdlib-js%2Frandom-streams-box-muller/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stdlib-js%2Frandom-streams-box-muller/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stdlib-js","download_url":"https://codeload.github.com/stdlib-js/random-streams-box-muller/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253786393,"owners_count":21964151,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bell","continuous","gaussian","generator","javascript","math","mathematics","node","node-js","nodejs","normal","prng","pseudorandom","rand","random","rng","standard","statistics","stats","stdlib"],"created_at":"2024-11-08T20:10:10.885Z","updated_at":"2025-05-12T17:27:33.381Z","avatar_url":"https://github.com/stdlib-js.png","language":"JavaScript","readme":"\u003c!--\n\n@license Apache-2.0\n\nCopyright (c) 2018 The Stdlib Authors.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\n--\u003e\n\n\n\u003cdetails\u003e\n  \u003csummary\u003e\n    About stdlib...\n  \u003c/summary\u003e\n  \u003cp\u003eWe believe in a future in which the web is a preferred environment for numerical computation. To help realize this future, we've built stdlib. stdlib is a standard library, with an emphasis on numerical and scientific computation, written in JavaScript (and C) for execution in browsers and in Node.js.\u003c/p\u003e\n  \u003cp\u003eThe library is fully decomposable, being architected in such a way that you can swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.\u003c/p\u003e\n  \u003cp\u003eWhen you use stdlib, you can be absolutely certain that you are using the most thorough, rigorous, well-written, studied, documented, tested, measured, and high-quality code out there.\u003c/p\u003e\n  \u003cp\u003eTo join us in bringing numerical computing to the web, get started by checking us out on \u003ca href=\"https://github.com/stdlib-js/stdlib\"\u003eGitHub\u003c/a\u003e, and please consider \u003ca href=\"https://opencollective.com/stdlib\"\u003efinancially supporting stdlib\u003c/a\u003e. We greatly appreciate your continued support!\u003c/p\u003e\n\u003c/details\u003e\n\n# Standard Normal Random Numbers\n\n[![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] \u003c!-- [![dependencies][dependencies-image]][dependencies-url] --\u003e\n\n\u003e Create a [readable stream][readable-stream] for generating pseudorandom numbers drawn from a [standard normal][normal] distribution using the [Box-Muller transform][@stdlib/random/base/box-muller].\n\n\u003csection class=\"installation\"\u003e\n\n## Installation\n\n```bash\nnpm install @stdlib/random-streams-box-muller\n```\n\nAlternatively,\n\n-   To load the package in a website via a `script` tag without installation and bundlers, use the [ES Module][es-module] available on the [`esm`][esm-url] branch (see [README][esm-readme]).\n-   If you are using Deno, visit the [`deno`][deno-url] branch (see [README][deno-readme] for usage intructions).\n-   For use in Observable, or in browser/node environments, use the [Universal Module Definition (UMD)][umd] build available on the [`umd`][umd-url] branch (see [README][umd-readme]).\n-   To use as a general utility for the command line, install the corresponding [CLI package][cli-section] globally.\n\nThe [branches.md][branches-url] file summarizes the available branches and displays a diagram illustrating their relationships.\n\nTo view installation and usage instructions specific to each branch build, be sure to explicitly navigate to the respective README files on each branch, as linked to above.\n\n\u003c/section\u003e\n\n\u003csection class=\"usage\"\u003e\n\n## Usage\n\n```javascript\nvar randomStream = require( '@stdlib/random-streams-box-muller' );\n```\n\n\u003ca name=\"random-stream\"\u003e\u003c/a\u003e\n\n#### randomStream( \\[options] )\n\nReturns a [readable stream][readable-stream] for generating pseudorandom numbers drawn from a [standard normal][normal] distribution using the [Box-Muller transform][@stdlib/random/base/box-muller].\n\n```javascript\nvar inspectStream = require( '@stdlib/streams-node-inspect-sink' );\n\nvar iStream;\nvar stream;\n\nfunction log( chunk, idx ) {\n    console.log( chunk.toString() );\n    if ( idx === 10 ) {\n        stream.destroy();\n    }\n}\n\nstream = randomStream();\niStream = inspectStream( log );\n\nstream.pipe( iStream );\n```\n\nThe function accepts the following `options`:\n\n-   **objectMode**: specifies whether a [stream][stream] should operate in [objectMode][object-mode]. Default: `false`.\n-   **encoding**: specifies how `Buffer` objects should be decoded to `strings`. Default: `null`.\n-   **highWaterMark**: specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers.\n-   **sep**: separator used to join streamed data. This option is only applicable when a stream is **not** in [objectMode][object-mode]. Default: `'\\n'`.\n-   **iter**: number of iterations.\n-   **prng**: pseudorandom number generator for generating uniformly distributed pseudorandom numbers on the interval `[0,1)`. If provided, the function **ignores** both the `state` and `seed` options. In order to seed the returned pseudorandom number generator stream, one must seed the provided `prng` (assuming the provided `prng` is seedable).\n-   **seed**: pseudorandom number generator seed.\n-   **state**: a [`Uint32Array`][@stdlib/array/uint32] containing pseudorandom number generator state. If provided, the function ignores the `seed` option.\n-   **copy**: `boolean` indicating whether to copy a provided pseudorandom number generator state. Setting this option to `false` allows sharing state between two or more pseudorandom number generators and/or streams. Setting this option to `true` ensures that a stream generator has exclusive control over its internal state. Default: `true`.\n-   **siter**: number of iterations after which to emit the pseudorandom number generator state. This option is useful when wanting to deterministically capture a stream's underlying PRNG state. Default: `1e308`.\n\nTo set [stream][stream] `options`,\n\n```javascript\nvar opts = {\n    'objectMode': true,\n    'encoding': 'utf8',\n    'highWaterMark': 64\n};\n\nvar stream = randomStream( opts );\n```\n\nBy default, the function returns a [stream][stream] which can generate an infinite number of values (i.e., the [stream][stream] will **never** end). To limit the number of generated pseudorandom numbers, set the `iter` option.\n\n```javascript\nvar inspectStream = require( '@stdlib/streams-node-inspect-sink' );\n\nfunction log( chunk ) {\n    console.log( chunk.toString() );\n}\n\nvar opts = {\n    'iter': 10\n};\n\nvar stream = randomStream( opts );\nvar iStream = inspectStream( log );\n\nstream.pipe( iStream );\n```\n\nBy default, when not operating in [objectMode][object-mode], a returned [stream][stream] delineates generated pseudorandom numbers using a newline character. To specify an alternative separator, set the `sep` option.\n\n```javascript\nvar inspectStream = require( '@stdlib/streams-node-inspect-sink' );\n\nfunction log( chunk ) {\n    console.log( chunk.toString() );\n}\n\nvar opts = {\n    'iter': 10,\n    'sep': ','\n};\n\nvar stream = randomStream( opts );\nvar iStream = inspectStream( log );\n\nstream.pipe( iStream );\n```\n\nTo seed the underlying pseudorandom number generator, set the `seed` option.\n\n```javascript\nvar inspectStream = require( '@stdlib/streams-node-inspect-sink' );\n\nfunction log( v ) {\n    console.log( v );\n}\n\nvar opts = {\n    'objectMode': true,\n    'iter': 10,\n    'seed': 1234\n};\n\nvar stream = randomStream( opts );\n\nopts = {\n    'objectMode': true\n};\nvar iStream = inspectStream( opts, log );\n\nstream.pipe( iStream );\n```\n\nTo return a [readable stream][readable-stream] with an underlying pseudorandom number generator having a specific initial state, set the `state` option.\n\n```javascript\nvar inspectStream = require( '@stdlib/streams-node-inspect-sink' );\n\nfunction log( v ) {\n    console.log( v );\n}\n\nvar opts1 = {\n    'objectMode': true,\n    'iter': 10\n};\n\nvar stream = randomStream( opts1 );\n\nvar opts2 = {\n    'objectMode': true\n};\nvar iStream = inspectStream( opts2, log );\n\n// Stream pseudorandom numbers, thus progressing the underlying generator state:\nstream.pipe( iStream );\n\n// Create a new PRNG stream initialized to the last state of the previous stream:\nvar opts3 = {\n    'objectMode': true,\n    'iter': 10,\n    'state': stream.state\n};\n\nstream = randomStream( opts3 );\niStream = inspectStream( opts2, log );\n\n// Stream pseudorandom numbers starting from the last state of the previous stream:\nstream.pipe( iStream );\n```\n\n##### stream.PRNG\n\nThe underlying pseudorandom number generator.\n\n```javascript\nvar stream = randomStream();\n\nvar prng = stream.PRNG;\n// returns \u003cFunction\u003e\n```\n\n##### stream.seed\n\nThe value used to seed the underlying pseudorandom number generator.\n\n```javascript\nvar stream = randomStream();\n\nvar seed = stream.seed;\n// returns \u003cUint32Array\u003e\n```\n\nIf provided a PRNG for uniformly distributed numbers, this value is `null`.\n\n```javascript\nvar minstd = require( '@stdlib/random-base-minstd-shuffle' ).normalized;\n\nvar stream = randomStream({\n    'prng': minstd\n});\n\nvar seed = stream.seed;\n// returns null\n```\n\n##### stream.seedLength\n\nLength of underlying pseudorandom number generator seed.\n\n```javascript\nvar stream = randomStream();\n\nvar len = stream.seedLength;\n// returns \u003cnumber\u003e\n```\n\nIf provided a PRNG for uniformly distributed numbers, this value is `null`.\n\n```javascript\nvar minstd = require( '@stdlib/random-base-minstd-shuffle' ).normalized;\n\nvar stream = randomStream({\n    'prng': minstd\n});\n\nvar len = stream.seedLength;\n// returns null\n```\n\n##### stream.state\n\nWritable property for getting and setting the underlying pseudorandom number generator state.\n\n```javascript\nvar stream = randomStream();\n\nvar state = stream.state;\n// returns \u003cUint32Array\u003e\n```\n\nIf provided a PRNG for uniformly distributed numbers, this value is `null`.\n\n```javascript\nvar minstd = require( '@stdlib/random-base-minstd-shuffle' ).normalized;\n\nvar stream = randomStream({\n    'prng': minstd\n});\n\nvar state = stream.state;\n// returns null\n```\n\n##### stream.stateLength\n\nLength of underlying pseudorandom number generator state.\n\n```javascript\nvar stream = randomStream();\n\nvar len = stream.stateLength;\n// returns \u003cnumber\u003e\n```\n\nIf provided a PRNG for uniformly distributed numbers, this value is `null`.\n\n```javascript\nvar minstd = require( '@stdlib/random-base-minstd-shuffle' ).normalized;\n\nvar stream = randomStream({\n    'prng': minstd\n});\n\nvar len = stream.stateLength;\n// returns null\n```\n\n##### stream.byteLength\n\nSize (in bytes) of underlying pseudorandom number generator state.\n\n```javascript\nvar stream = randomStream();\n\nvar sz = stream.byteLength;\n// returns \u003cnumber\u003e\n```\n\nIf provided a PRNG for uniformly distributed numbers, this value is `null`.\n\n```javascript\nvar minstd = require( '@stdlib/random-base-minstd-shuffle' ).normalized;\n\nvar stream = randomStream({\n    'prng': minstd\n});\n\nvar sz = stream.byteLength;\n// returns null\n```\n\n* * *\n\n#### randomStream.factory( \\[options] )\n\nReturns a `function` for creating [readable streams][readable-stream] which generate pseudorandom numbers drawn from a [standard normal][normal] distribution using the [Box-Muller transform][@stdlib/random/base/box-muller].\n\n```javascript\nvar opts = {\n    'objectMode': true,\n    'encoding': 'utf8',\n    'highWaterMark': 64\n};\n\nvar createStream = randomStream.factory( opts );\n```\n\nThe method accepts the same `options` as [`randomStream()`](#random-stream).\n\n* * *\n\n#### randomStream.objectMode( \\[options] )\n\nThis method is a convenience function to create [streams][stream] which **always** operate in [objectMode][object-mode].\n\n```javascript\nvar inspectStream = require( '@stdlib/streams-node-inspect-sink' );\n\nfunction log( v ) {\n    console.log( v );\n}\n\nvar opts = {\n    'iter': 10\n};\nvar stream = randomStream.objectMode( opts );\n\nopts = {\n    'objectMode': true\n};\nvar iStream = inspectStream( opts, log );\n\nstream.pipe( iStream );\n```\n\nThis method accepts the same `options` as [`randomStream()`](#random-stream); however, the method will **always** override the [`objectMode`][object-mode] option in `options`.\n\n* * *\n\n### Events\n\nIn addition to the standard [readable stream][readable-stream] events, the following events are supported...\n\n#### 'state'\n\nEmitted after internally generating `siter` pseudorandom numbers.\n\n```javascript\nvar opts = {\n    'siter': 10 // emit the PRNG state every 10 pseudorandom numbers\n};\n\nvar stream = randomStream( opts );\n\nstream.on( 'state', onState );\n\nfunction onState( state ) {\n    // Do something with the emitted state, such as save to file...\n}\n```\n\n\u003c/section\u003e\n\n\u003c!-- /.usage --\u003e\n\n* * *\n\n\u003csection class=\"notes\"\u003e\n\n## Notes\n\n-   If PRNG state is \"shared\" (meaning a state array was provided during stream creation and **not** copied) and one sets the generator state to a state array having a different length, the underlying PRNG does **not** update the existing shared state and, instead, points to the newly provided state array. In order to synchronize PRNG output according to the new shared state array, the state array for **each** relevant PRNG must be **explicitly** set.\n-   If PRNG state is \"shared\" and one sets the generator state to a state array of the same length, the PRNG state is updated (along with the state of all other PRNGs sharing the PRNG's state array).\n-   In order to capture the PRNG state after a specific number of generated pseudorandom numbers, regardless of internal stream buffering, use the `siter` option in conjunction with a `state` event listener. Attempting to capture the underlying PRNG state after **reading** generated numbers is **not** likely to give expected results, as internal stream buffering will mean more values have been generated than have been read. Thus, the state returned by the `state` property will likely reflect a future PRNG state from the perspective of downstream consumers.\n\n\u003c/section\u003e\n\n\u003c!-- /.notes --\u003e\n\n* * *\n\n\u003csection class=\"examples\"\u003e\n\n## Examples\n\n\u003c!-- eslint no-undef: \"error\" --\u003e\n\n```javascript\nvar inspectStream = require( '@stdlib/streams-node-inspect-sink' );\nvar randomStream = require( '@stdlib/random-streams-box-muller' );\n\nfunction log( v ) {\n    console.log( v.toString() );\n}\n\nvar opts = {\n    'objectMode': true,\n    'iter': 10\n};\n\nvar stream = randomStream( opts );\n\nopts = {\n    'objectMode': true\n};\nvar iStream = inspectStream( opts, log );\n\nstream.pipe( iStream );\n```\n\n\u003c/section\u003e\n\n\u003c!-- /.examples --\u003e\n\n\u003c!-- Section for describing a command-line interface. --\u003e\n\n* * *\n\n\u003csection class=\"cli\"\u003e\n\n## CLI\n\n\u003csection class=\"installation\"\u003e\n\n## Installation\n\nTo use as a general utility, install the CLI package globally\n\n```bash\nnpm install -g @stdlib/random-streams-box-muller-cli\n```\n\n\u003c/section\u003e\n\u003c!-- CLI usage documentation. --\u003e\n\n\n\u003csection class=\"usage\"\u003e\n\n### Usage\n\n```text\nUsage: random-box-muller [options]\n\nOptions:\n\n  -h,  --help               Print this message.\n  -V,  --version            Print the package version.\n       --sep sep            Separator used to join streamed data. Default: '\\n'.\n  -n,  --iter iterations    Number of pseudorandom numbers.\n       --seed seed          Pseudorandom number generator seed.\n       --state filepath     Path to a file containing the pseudorandom number\n                            generator state.\n       --snapshot filepath  Output file path for saving the pseudorandom number\n                            generator state upon exit.\n```\n\n\u003c/section\u003e\n\n\u003c!-- /.usage --\u003e\n\n\u003c!-- CLI usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. --\u003e\n\n\u003csection class=\"notes\"\u003e\n\n### Notes\n\n-   In accordance with POSIX convention, a trailing newline is **always** appended to generated output prior to exit.\n-   Specifying a \"snapshot\" file path is useful when wanting to resume pseudorandom number generation due to, e.g., a downstream failure in an analysis pipeline. Before exiting, the process will store the pseudorandom number generator state in a file specified according to a provided file path. Upon loading a snapshot (state), the process will generate pseudorandom numbers starting from the loaded state, thus avoiding having to seed and replay an entire analysis.\n\n\u003c/section\u003e\n\n\u003c!-- /.notes --\u003e\n\n\u003c!-- CLI usage examples. --\u003e\n\n\u003csection class=\"examples\"\u003e\n\n### Examples\n\n```bash\n$ random-box-muller -n 10 --seed 1234\n```\n\n\u003c/section\u003e\n\n\u003c!-- /.examples --\u003e\n\n\u003c/section\u003e\n\n\u003c!-- /.cli --\u003e\n\n* * *\n\n\u003csection class=\"references\"\u003e\n\n## References\n\n-   Box, G. E. P., and Mervin E. Muller. 1958. \"A Note on the Generation of Random Normal Deviates.\" _The Annals of Mathematical Statistics_ 29 (2). The Institute of Mathematical Statistics: 610–11. doi:[10.1214/aoms/1177706645][@box:1958].\n-   Bell, James R. 1968. \"Algorithm 334: Normal Random Deviates.\" _Communications of the ACM_ 11 (7). New York, NY, USA: ACM: 498. doi:[10.1145/363397.363547][@bell:1968].\n-   Knop, R. 1969. \"Remark on Algorithm 334 \\[G5]: Normal Random Deviates.\" _Communications of the ACM_ 12 (5). New York, NY, USA: ACM: 281. doi:[10.1145/362946.362996][@knop:1969].\n-   Marsaglia, G., and T. A. Bray. 1964. \"A Convenient Method for Generating Normal Variables.\" _SIAM Review_ 6 (3). Society for Industrial; Applied Mathematics: 260–64. doi:[10.1137/1006063][@marsaglia:1964a].\n-   Thomas, David B., Wayne Luk, Philip H.W. Leong, and John D. Villasenor. 2007. \"Gaussian Random Number Generators.\" _ACM Computing Surveys_ 39 (4). New York, NY, USA: ACM. doi:[10.1145/1287620.1287622][@thomas:2007].\n\n\u003c/section\u003e\n\n\u003c!-- /.references --\u003e\n\n\u003c!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. --\u003e\n\n\u003csection class=\"related\"\u003e\n\n* * *\n\n## See Also\n\n-   \u003cspan class=\"package-name\"\u003e[`@stdlib/random-base/box-muller`][@stdlib/random/base/box-muller]\u003c/span\u003e\u003cspan class=\"delimiter\"\u003e: \u003c/span\u003e\u003cspan class=\"description\"\u003enormally distributed pseudorandom numbers using the Box-Muller transform.\u003c/span\u003e\n-   \u003cspan class=\"package-name\"\u003e[`@stdlib/random-iter/box-muller`][@stdlib/random/iter/box-muller]\u003c/span\u003e\u003cspan class=\"delimiter\"\u003e: \u003c/span\u003e\u003cspan class=\"description\"\u003ecreate an iterator for generating pseudorandom numbers drawn from a standard normal distribution using the Box-Muller transform.\u003c/span\u003e\n-   \u003cspan class=\"package-name\"\u003e[`@stdlib/random-streams/improved-ziggurat`][@stdlib/random/streams/improved-ziggurat]\u003c/span\u003e\u003cspan class=\"delimiter\"\u003e: \u003c/span\u003e\u003cspan class=\"description\"\u003ecreate a readable stream for generating pseudorandom numbers drawn from a standard normal distribution using the Improved Ziggurat algorithm.\u003c/span\u003e\n-   \u003cspan class=\"package-name\"\u003e[`@stdlib/random-streams/randn`][@stdlib/random/streams/randn]\u003c/span\u003e\u003cspan class=\"delimiter\"\u003e: \u003c/span\u003e\u003cspan class=\"description\"\u003ecreate a readable stream for generating pseudorandom numbers drawn from a standard normal distribution.\u003c/span\u003e\n\n\u003c/section\u003e\n\n\u003c!-- /.related --\u003e\n\n\u003c!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. --\u003e\n\n\n\u003csection class=\"main-repo\" \u003e\n\n* * *\n\n## Notice\n\nThis package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.\n\nFor more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib].\n\n#### Community\n\n[![Chat][chat-image]][chat-url]\n\n---\n\n## License\n\nSee [LICENSE][stdlib-license].\n\n\n## Copyright\n\nCopyright \u0026copy; 2016-2025. The Stdlib [Authors][stdlib-authors].\n\n\u003c/section\u003e\n\n\u003c!-- /.stdlib --\u003e\n\n\u003c!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. --\u003e\n\n\u003csection class=\"links\"\u003e\n\n[npm-image]: http://img.shields.io/npm/v/@stdlib/random-streams-box-muller.svg\n[npm-url]: https://npmjs.org/package/@stdlib/random-streams-box-muller\n\n[test-image]: https://github.com/stdlib-js/random-streams-box-muller/actions/workflows/test.yml/badge.svg?branch=main\n[test-url]: https://github.com/stdlib-js/random-streams-box-muller/actions/workflows/test.yml?query=branch:main\n\n[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/random-streams-box-muller/main.svg\n[coverage-url]: https://codecov.io/github/stdlib-js/random-streams-box-muller?branch=main\n\n\u003c!--\n\n[dependencies-image]: https://img.shields.io/david/stdlib-js/random-streams-box-muller.svg\n[dependencies-url]: https://david-dm.org/stdlib-js/random-streams-box-muller/main\n\n--\u003e\n\n[chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg\n[chat-url]: https://app.gitter.im/#/room/#stdlib-js_stdlib:gitter.im\n\n[stdlib]: https://github.com/stdlib-js/stdlib\n\n[stdlib-authors]: https://github.com/stdlib-js/stdlib/graphs/contributors\n\n[cli-section]: https://github.com/stdlib-js/random-streams-box-muller#cli\n[cli-url]: https://github.com/stdlib-js/random-streams-box-muller/tree/cli\n[@stdlib/random-streams-box-muller]: https://github.com/stdlib-js/random-streams-box-muller/tree/main\n\n[umd]: https://github.com/umdjs/umd\n[es-module]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules\n\n[deno-url]: https://github.com/stdlib-js/random-streams-box-muller/tree/deno\n[deno-readme]: https://github.com/stdlib-js/random-streams-box-muller/blob/deno/README.md\n[umd-url]: https://github.com/stdlib-js/random-streams-box-muller/tree/umd\n[umd-readme]: https://github.com/stdlib-js/random-streams-box-muller/blob/umd/README.md\n[esm-url]: https://github.com/stdlib-js/random-streams-box-muller/tree/esm\n[esm-readme]: https://github.com/stdlib-js/random-streams-box-muller/blob/esm/README.md\n[branches-url]: https://github.com/stdlib-js/random-streams-box-muller/blob/main/branches.md\n\n[stdlib-license]: https://raw.githubusercontent.com/stdlib-js/random-streams-box-muller/main/LICENSE\n\n[stream]: https://nodejs.org/api/stream.html\n\n[object-mode]: https://nodejs.org/api/stream.html#stream_object_mode\n\n[readable-stream]: https://nodejs.org/api/stream.html\n\n[normal]: https://en.wikipedia.org/wiki/Normal_distribution\n\n[@stdlib/array/uint32]: https://github.com/stdlib-js/array-uint32\n\n[@box:1958]: http://dx.doi.org/10.1214/aoms/1177706645\n\n[@bell:1968]: http://dx.doi.org/10.1145/363397.363547\n\n[@knop:1969]: http://dx.doi.org/10.1145/362946.362996\n\n[@marsaglia:1964a]: http://dx.doi.org/10.1137/1006063\n\n[@thomas:2007]: http://dx.doi.org/10.1145/1287620.128762\n\n\u003c!-- \u003crelated-links\u003e --\u003e\n\n[@stdlib/random/base/box-muller]: https://github.com/stdlib-js/random-base-box-muller\n\n[@stdlib/random/iter/box-muller]: https://github.com/stdlib-js/random-iter-box-muller\n\n[@stdlib/random/streams/improved-ziggurat]: https://github.com/stdlib-js/random-streams-improved-ziggurat\n\n[@stdlib/random/streams/randn]: https://github.com/stdlib-js/random-streams-randn\n\n\u003c!-- \u003c/related-links\u003e --\u003e\n\n\u003c/section\u003e\n\n\u003c!-- /.links --\u003e\n","funding_links":["https://github.com/sponsors/stdlib-js","https://opencollective.com/stdlib","https://tidelift.com/funding/github/npm/@stdlib/stdlib"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstdlib-js%2Frandom-streams-box-muller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstdlib-js%2Frandom-streams-box-muller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstdlib-js%2Frandom-streams-box-muller/lists"}