UNPKG

@stdlib/esm

Version:

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

3 lines 1.49 kB
// 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 n from"./../../math/base/special/floor.js";var e=n,a=128;function f(r,n,t,o,u){var i,N,v,l,m,p,s,c,d,y,b,j,h,x;if(i=u,r<8){for(b=0,j=0,x=0;x<r;x++)(h=t[i])==h&&(b+=h,j+=1),i+=o;return n[0]+=b,n[1]+=j,n}if(r<=a){for(N=0,v=0,l=0,m=0,p=0,s=0,c=0,d=0,j=0,y=r%8,x=0;x<r-y;x+=8)(h=t[i])==h&&(N+=h,j+=1),(h=t[i+=o])==h&&(v+=h,j+=1),(h=t[i+=o])==h&&(l+=h,j+=1),(h=t[i+=o])==h&&(m+=h,j+=1),(h=t[i+=o])==h&&(p+=h,j+=1),(h=t[i+=o])==h&&(s+=h,j+=1),(h=t[i+=o])==h&&(c+=h,j+=1),(h=t[i+=o])==h&&(d+=h,j+=1),i+=o;for(b=N+v+(l+m)+(p+s+(c+d));x<r;x++)(h=t[i])==h&&(b+=h,j+=1),i+=o;return n[0]+=b,n[1]+=j,n}return j=e(r/2),f(j-=j%8,n,t,o,i)+f(r-j,n,t,o,i+j*o)}var t=f,o=[0,0];function u(r,n,e,a){var f,u,i,N,v,l,m,p,s;if(r<=0)return NaN;if(1===r||0===a)return(m=e[0])==m&&r-n>0?0:NaN;if(u=a<0?(1-r)*a:0,o[0]=0,o[1]=0,t(r,o,e,a,u),(N=(p=o[1])-n)<=0)return NaN;for(f=o[0]/p,i=0,v=0,s=0;s<r;s++)(m=e[u])==m&&(i+=(l=m-f)*l,v+=l),u+=a;return i/N-v/p*(v/N)}var i=f,N=[0,0];function v(r,n,e,a,f){var t,o,u,v,l,m,p,s,c;if(r<=0)return NaN;if(1===r||0===a)return(p=e[f])==p&&r-n>0?0:NaN;if(N[0]=0,N[1]=0,i(r,N,e,a,f),(v=(s=N[1])-n)<=0)return NaN;for(t=N[0]/s,o=f,u=0,l=0,c=0;c<r;c++)(p=e[o])==p&&(u+=(m=p-t)*m,l+=m),o+=a;return u/v-l/s*(l/v)}var l=r,m=u,p=v;l(m,"ndarray",p);export default m; //# sourceMappingURL=nanvariancepn.js.map