@stdlib/esm
Version:
ES module distribution for Stdlib, a standard library for JavaScript and Node.js.
3 lines • 1.7 kB
JavaScript
// This file is a part of stdlib. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0
import r from"./../../utils/define-nonenumerable-read-only-property.js";import t from"./../../number/float64/base/to-float32.js";import a from"./../../math/base/special/floor.js";var e=t,f=a,n=128;function o(r,t,a,u,i){var N,m,l,p,s,v,b,c,d,j,y,h,x,g;if(N=i,r<8){for(y=0,h=0,g=0;g<r;g++)(x=a[N])==x&&(y=e(y+x),h+=1),N+=u;return t[0]=e(t[0]+y),t[1]+=h,t}if(r<=n){for(m=0,l=0,p=0,s=0,v=0,b=0,c=0,d=0,h=0,j=r%8,g=0;g<r-j;g+=8)(x=a[N])==x&&(m=e(m+x),h+=1),(x=a[N+=u])==x&&(l=e(l+x),h+=1),(x=a[N+=u])==x&&(p=e(p+x),h+=1),(x=a[N+=u])==x&&(s=e(s+x),h+=1),(x=a[N+=u])==x&&(v=e(v+x),h+=1),(x=a[N+=u])==x&&(b=e(b+x),h+=1),(x=a[N+=u])==x&&(c=e(c+x),h+=1),(x=a[N+=u])==x&&(d=e(d+x),h+=1),N+=u;for(y=e(e(e(m+l)+e(p+s))+e(e(v+b)+e(c+d)));g<r;g++)(x=a[N])==x&&(y=e(y+x),h+=1),N+=u;return t[0]=e(t[0]+y),t[1]+=h,t}return h=f(r/2),e(o(h-=h%8,t,a,u,N)+o(r-h,t,a,u,N+h*u))}var u=t,i=o,N=[0,0];function m(r,t,a,e){var f,n,o,m,l,p,s,v,b;if(r<=0)return NaN;if(1===r||0===e)return(s=a[0])==s&&r-t>0?0:NaN;if(n=e<0?(1-r)*e:0,N[0]=0,N[1]=0,i(r,N,a,e,n),(m=(v=N[1])-t)<=0)return NaN;for(f=u(N[0]/v),o=0,l=0,b=0;b<r;b++)(s=a[n])==s&&(p=u(s-f),o=u(o+u(p*p)),l=u(l+p),v+=1),n+=e;return u(u(o/m)-u(u(l/v)*u(l/m)))}var l=t,p=o,s=[0,0];function v(r,t,a,e,f){var n,o,u,i,N,m,v,b,c;if(r<=0)return NaN;if(1===r||0===e)return(v=a[f])==v&&r-t>0?0:NaN;if(o=f,s[0]=0,s[1]=0,p(r,s,a,e,o),(i=(b=s[1])-t)<=0)return NaN;for(n=l(s[0]/b),u=0,N=0,c=0;c<r;c++)(v=a[o])==v&&(m=l(v-n),u=l(u+l(m*m)),N=l(N+m),b+=1),o+=e;return l(l(u/i)-l(l(N/b)*l(N/i)))}var b=r,c=m,d=v;b(c,"ndarray",d);export default c;
//# sourceMappingURL=snanvariancepn.js.map