@stdlib/random-base-weibull
Version:
Weibull distributed pseudorandom numbers.
12 lines (11 loc) • 2.69 kB
JavaScript
;var s=function(n,e){return function(){return e||n((e={exports:{}}).exports,e),e.exports}};var q=s(function(k,d){
var c=require('@stdlib/assert-is-positive-number/dist').isPrimitive,m=require('@stdlib/error-tools-fmtprodmsg/dist');function B(n,e){return c(n)?c(e)?null:new TypeError(m('0pD7d',e)):new TypeError(m('0pD7c',n));}d.exports=B
});var b=s(function(ee,h){
var C=require('@stdlib/math-base-special-pow/dist'),D=require('@stdlib/math-base-special-ln/dist');function H(n,e,r){return r*C(-D(1-n()),1/e)}h.exports=H
});var f=s(function(re,R){
var i=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),o=require('@stdlib/utils-define-nonenumerable-read-only-accessor/dist'),y=require('@stdlib/utils-define-nonenumerable-read-write-accessor/dist'),w=require('@stdlib/assert-is-plain-object/dist'),O=require('@stdlib/assert-is-function/dist'),S=require('@stdlib/assert-has-own-property/dist'),L=require('@stdlib/utils-constant-function/dist'),I=require('@stdlib/utils-noop/dist'),l=require('@stdlib/random-base-mt19937/dist').factory,N=require('@stdlib/math-base-assert-is-nan/dist'),K=require('@stdlib/array-to-json/dist'),g=require('@stdlib/error-tools-fmtprodmsg/dist'),Q=q(),E=b();function U(){var n,e,r,t,p,u;if(arguments.length===0)r=l();else if(arguments.length===1){if(e=arguments[0],!w(e))throw new TypeError(g('0pD2V',e));if(S(e,"prng")){if(!O(e.prng))throw new TypeError(g('0pD6u',"prng",e.prng));r=e.prng}else r=l(e)}else{if(u=arguments[0],n=arguments[1],p=Q(n,u),p)throw p;if(arguments.length>2){if(e=arguments[2],!w(e))throw new TypeError(g('0pD2V',e));if(S(e,"prng")){if(!O(e.prng))throw new TypeError(g('0pD6u',"prng",e.prng));r=e.prng}else r=l(e)}else r=l()}return n===void 0?t=W:t=M,i(t,"NAME","weibull"),e&&e.prng?(i(t,"seed",null),i(t,"seedLength",null),y(t,"state",L(null),I),i(t,"stateLength",null),i(t,"byteLength",null),i(t,"toJSON",L(null)),i(t,"PRNG",r)):(o(t,"seed",j),o(t,"seedLength",A),y(t,"state",J,z),o(t,"stateLength",V),o(t,"byteLength",G),i(t,"toJSON",F),i(t,"PRNG",r),r=r.normalized),t;function j(){return r.seed}function A(){return r.seedLength}function V(){return r.stateLength}function G(){return r.byteLength}function J(){return r.state}function z(a){r.state=a}function F(){var a={};return a.type="PRNG",a.name=t.NAME,a.state=K(r.state),u===void 0?a.params=[]:a.params=[u,n],a}function M(){return E(r,u,n)}function W(a,v){return N(a)||N(v)||a<=0||v<=0?NaN:E(r,a,v)}}R.exports=U
});var T=s(function(te,P){
var X=f(),Y=X();P.exports=Y
});var Z=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),x=T(),_=f();Z(x,"factory",_);module.exports=x;
/** @license Apache-2.0 */
//# sourceMappingURL=index.js.map