@stdlib/random-base-randn
Version:
Standard normal pseudorandom numbers.
10 lines (9 loc) • 2.56 kB
JavaScript
;var d=function(t,e){return function(){return e||t((e={exports:{}}).exports,e),e.exports}};var f=d(function(C,A){A.exports={name:"improved-ziggurat",copy:!0}});var l=d(function(D,g){
var G=require('@stdlib/random-base-box-muller/dist'),M=require('@stdlib/random-base-improved-ziggurat/dist'),c={};c["box-muller"]=G;c["improved-ziggurat"]=M;g.exports=c
});var v=d(function(H,q){
var a=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),p=require('@stdlib/utils-define-nonenumerable-read-only-accessor/dist'),y=require('@stdlib/utils-define-nonenumerable-read-write-accessor/dist'),T=require('@stdlib/assert-is-plain-object/dist'),z=require('@stdlib/assert-is-boolean/dist').isPrimitive,u=require('@stdlib/assert-has-own-property/dist'),m=require('@stdlib/utils-constant-function/dist'),s=require('@stdlib/error-tools-fmtprodmsg/dist'),j=require('@stdlib/utils-noop/dist'),J=require('@stdlib/array-to-json/dist'),h=f(),B=l();function F(t){var e,n,o;if(e={name:h.name,copy:h.copy},arguments.length){if(!T(t))throw new TypeError(s('0oz47',t));if(u(t,"name")&&(e.name=t.name),u(t,"prng")){if(e.prng=t.prng,e.prng===void 0)throw new TypeError(s('0oz7Y',"prng",e.prng))}else if(u(t,"state")){if(e.state=t.state,e.state===void 0)throw new TypeError(s('0oz7Y',"state",e.state))}else if(u(t,"seed")&&(e.seed=t.seed,e.seed===void 0))throw new TypeError(s('0oz7Y',"seed",e.seed));if(u(t,"copy")&&(e.copy=t.copy,!z(e.copy)))throw new TypeError(s('0oz2o',"copy",e.copy))}if(o=B[e.name],o===void 0)throw new Error(s('0oz7Z',e.name));return e.prng===void 0?e.state===void 0?e.seed===void 0?n=o.factory():n=o.factory({seed:e.seed}):n=o.factory({state:e.state,copy:e.copy}):n=o.factory({prng:e.prng}),a(r,"NAME","randn"),e.prng?(a(r,"seed",null),a(r,"seedLength",null),y(r,"state",m(null),j),a(r,"stateLength",null),a(r,"byteLength",null),a(r,"toJSON",m(null))):(p(r,"seed",L),p(r,"seedLength",N),y(r,"state",R,P),p(r,"stateLength",S),p(r,"byteLength",E),a(r,"toJSON",x)),a(r,"PRNG",n.PRNG),r;function L(){return n.seed}function N(){return n.seedLength}function S(){return n.stateLength}function E(){return n.byteLength}function R(){return n.state}function P(i){n.state=i}function x(){var i={};return i.type="PRNG",i.name=r.NAME+"-"+n.NAME,i.state=J(n.state),i.params=[],i}function r(){return n()}}q.exports=F
});var O=d(function(I,w){
var U=v(),V=U();w.exports=V
});var W=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),b=O(),Z=v();W(b,"factory",Z);module.exports=b;
/** @license Apache-2.0 */
//# sourceMappingURL=index.js.map