UNPKG

@stdlib/esm

Version:

ES module distribution for Stdlib, a standard library for JavaScript and Node.js.

3 lines 3.01 kB
// This file is a part of stdlib. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 import n from"./../../utils/define-nonenumerable-read-only-property.js";import e from"./../../utils/define-nonenumerable-read-only-accessor.js";import t from"./../../utils/define-nonenumerable-read-write-accessor.js";import r from"./../../assert/is-plain-object.js";import o from"./../../assert/is-function.js";import i from"./../../assert/has-own-property.js";import a from"./../../utils/constant-function.js";import s 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-nan.js";import g from"./../../math/base/special/pow.js";import c from"./../../math/base/special/sin.js";import d from"./../../constants/math/float64-half-pi.js";var b=l.isPrimitive,h=f;function j(n,e){return!b(n)||h(n)?new TypeError("invalid argument. First argument must be a number primitive and not `NaN`. Value: `"+n+"`."):!b(e)||h(e)?new TypeError("invalid argument. Second argument must be a number primitive and not `NaN`. Value: `"+e+"`."):n>=e?new RangeError("invalid argument. Minimum support `a` must be less than maximum support `b`. Value: `["+n+","+e+"]`."):null}var v=g,y=c,w=d;function N(n,e,t){return e+v(y(w*n()),2)*(t-e)}var E=n,L=e,O=t,T=r,V=o,P=i,R=a,G=s,M=u.factory,S=m,x=p,A=j,J=N;function z(){var n,e,t,r,o,i;if(0===arguments.length)e=M();else if(1===arguments.length){if(!T(n=arguments[0]))throw new TypeError("invalid argument. Options argument must be an object. Value: `"+n+"`.");if(P(n,"prng")){if(!V(n.prng))throw new TypeError("invalid option. `prng` option must be a pseudorandom number generator function. Option: `"+n.prng+"`.");e=n.prng}else e=M(n)}else{if(r=A(o=arguments[0],i=arguments[1]))throw r;if(arguments.length>2){if(!T(n=arguments[2]))throw new TypeError("invalid argument. Options argument must be an object. Value: `"+n+"`.");if(P(n,"prng")){if(!V(n.prng))throw new TypeError("invalid option. `prng` option must be a pseudorandom number generator function. Option: `"+n.prng+"`.");e=n.prng}else e=M(n)}else e=M()}return E(t=void 0===o?c:g,"NAME","arcsine"),n&&n.prng?(E(t,"seed",null),E(t,"seedLength",null),O(t,"state",R(null),G),E(t,"stateLength",null),E(t,"byteLength",null),E(t,"toJSON",R(null)),E(t,"PRNG",e)):(L(t,"seed",a),L(t,"seedLength",s),O(t,"state",p,l),L(t,"stateLength",u),L(t,"byteLength",m),E(t,"toJSON",f),E(t,"PRNG",e),e=e.normalized),t;function a(){return e.seed}function s(){return e.seedLength}function u(){return e.stateLength}function m(){return e.byteLength}function p(){return e.state}function l(n){e.state=n}function f(){var n={type:"PRNG"};return n.name=t.NAME,n.state=x(e.state),n.params=void 0===o?[]:[o,i],n}function g(){return J(e,o,i)}function c(n,t){return S(n)||S(t)||n>=t?NaN:J(e,n,t)}}var F=z,k=F(),q=n,B=k,C=z;q(B,"factory",C);export default B; //# sourceMappingURL=arcsine.js.map