@stdlib/esm
Version:
ES module distribution for Stdlib, a standard library for JavaScript and Node.js.
3 lines • 2.8 kB
JavaScript
// This file is a part of stdlib. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0
import e from"./../../utils/define-nonenumerable-read-only-property.js";import r from"./../../utils/define-nonenumerable-read-only-accessor.js";import n from"./../../utils/define-nonenumerable-read-write-accessor.js";import t from"./../../assert/is-plain-object.js";import o from"./../../assert/is-function.js";import i from"./../../assert/has-own-property.js";import s from"./../../utils/constant-function.js";import a from"./../../utils/noop.js";import u from"./mt19937.js";import m from"./../../math/base/assert/is-nan.js";import p from"./../../array/to-json.js";import l from"./../../assert/is-number.js";import f from"./../../assert/is-positive-number.js";import g from"./../../assert/is-nan.js";import c from"./../../math/base/special/ln.js";var d=l.isPrimitive,b=f.isPrimitive,h=g;function v(e,r){return!d(e)||h(e)?new TypeError("invalid argument. `mu` must be a number primitive and not `NaN`. Value: `"+e+"`."):b(r)?null:new TypeError("invalid argument. `s` must be a positive number. Value: `"+r+"`.")}var j=c;function y(e,r,n){var t=e();return r+n*j(t/(1-t))}var w=e,N=r,L=n,E=t,O=o,T=i,P=s,V=a,G=u.factory,R=m,A=p,J=v,M=y;function S(){var e,r,n,t,o,i;if(0===arguments.length)r=G();else if(1===arguments.length){if(!E(e=arguments[0]))throw new TypeError("invalid argument. Options argument must be an object. Value: `"+e+"`.");if(T(e,"prng")){if(!O(e.prng))throw new TypeError("invalid option. `prng` option must be a pseudorandom number generator function. Option: `"+e.prng+"`.");r=e.prng}else r=G(e)}else{if(t=J(o=arguments[0],i=arguments[1]))throw t;if(arguments.length>2){if(!E(e=arguments[2]))throw new TypeError("invalid argument. Options argument must be an object. Value: `"+e+"`.");if(T(e,"prng")){if(!O(e.prng))throw new TypeError("invalid option. `prng` option must be a pseudorandom number generator function. Option: `"+e.prng+"`.");r=e.prng}else r=G(e)}else r=G()}return w(n=void 0===o?c:g,"NAME","logistic"),e&&e.prng?(w(n,"seed",null),w(n,"seedLength",null),L(n,"state",P(null),V),w(n,"stateLength",null),w(n,"byteLength",null),w(n,"toJSON",P(null)),w(n,"PRNG",r)):(N(n,"seed",s),N(n,"seedLength",a),L(n,"state",p,l),N(n,"stateLength",u),N(n,"byteLength",m),w(n,"toJSON",f),w(n,"PRNG",r),r=r.normalized),n;function s(){return r.seed}function a(){return r.seedLength}function u(){return r.stateLength}function m(){return r.byteLength}function p(){return r.state}function l(e){r.state=e}function f(){var e={type:"PRNG"};return e.name=n.NAME,e.state=A(r.state),e.params=void 0===o?[]:[o,i],e}function g(){return M(r,o,i)}function c(e,n){return R(e)||R(n)||n<=0?NaN:M(r,e,n)}}var x=S,z=x(),k=e,q=z,B=S;k(q,"factory",B);export default q;
//# sourceMappingURL=logistic.js.map