@stdlib/esm
Version:
ES module distribution for Stdlib, a standard library for JavaScript and Node.js.
3 lines • 1.02 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"./../../assert/is-number.js";import e from"./../../math/base/assert/is-nan.js";import t from"./../../math/base/special/sqrt.js";var n=r.isPrimitive,i=e,a=t;function u(r,e){var t,u,m,s,o,l,f,p,v,b,g,h;if(t=0,u=0,g=0,h=0,arguments.length){if(!n(r))throw new TypeError("invalid argument. First argument must be a number primitive. Value: `"+r+"`.");if(!n(e))throw new TypeError("invalid argument. Second argument must be a number primitive. Value: `"+e+"`.");return f=r,p=e,d}return f=0,p=0,c;function c(r,e){var n;return 0===arguments.length?0===h?null:1===h?i(t)||i(u)?NaN:0:g/(h-1)/(v*b):(t+=(l=r-f)*(r-(f+=l/(h+=1))),u+=(s=e-(p+=(m=e-p)/h))*m,g+=l*s,h<2?i(t)||i(u)?NaN:0:(v=a(t/(n=h-1)),b=a(u/n),g/n/(v*b)))}function d(r,e){return 0===arguments.length?0===h?null:g/h/(v*b):(u+=(o=e-p)*o,g+=(l=r-f)*o,v=a((t+=l*l)/(h+=1)),b=a(u/h),g/h/(v*b))}}var m=u;export default m;
//# sourceMappingURL=pcorr.js.map