function accumulator1( x, y ) {
		var v1;
		var v2;
		var n1;
		var k;
		var j;
		if ( arguments.length === 0 ) {
			if ( N === 0 ) {
				return null;
			}
			if ( N === 1 ) {
				return 0.0;
			}
			if ( N < W ) {
				return ( C/(N-1) ) / ( sx*sy );
			}
			return ( C/n ) / ( sx*sy );
		}
		// Update the window and strided array indices for managing the circular buffer:
		wi = (wi+1) % W;
		i = 2 * wi;

		// Case: an incoming value is NaN, the sliding co-moment is automatically NaN...
		if ( isnan( x ) || isnan( y ) ) {
			N = W; // explicitly set to avoid `N < W` branch
			C = NaN;
		}
		// Case: initial window...
		else if ( N < W ) {
			buf[ i ] = x; // update buffer
			buf[ i+1 ] = y;

			N += 1;

			dx = x - mx;
			mx += dx / N;
			M2x += dx * ( x-mx );

			dy = y - my;
			my += dy / N;
			dyN = y - my;
			M2y += dy * dyN;

			C += dx * dyN;
			if ( N === 1 ) {
				return 0.0;
			}
			n1 = N - 1;
			sx = sqrt( M2x/n1 );
			sy = sqrt( M2y/n1 );
			return ( C/n1 ) / ( sx*sy ); // Note: why all the dividing by `N`? To avoid overflow.
		}
		// Case: N = W = 1
		else if ( N === 1 ) {
			return 0.0;
		}
		// Case: an outgoing value is NaN, and, thus, we need to compute the accumulated values...
		else if ( isnan( buf[ i ] ) || isnan( buf[ i+1 ] ) ) {
			N = 1;
			mx = x;
			my = y;
			M2x = 0.0;
			M2y = 0.0;
			C = 0.0;
			for ( k = 0; k < W; k++ ) {
				j = 2 * k; // convert to a strided array index
				if ( j !== i ) {
					v1 = buf[ j ];
					v2 = buf[ j+1 ];
					if ( isnan( v1 ) || isnan( v2 ) ) {
						N = W; // explicitly set to avoid `N < W` branch
						C = NaN;
						break; // co-moment is automatically NaN, so no need to continue
					}
					N += 1;

					dx = v1 - mx;
					mx += dx / N;
					M2x += dx * ( v1-mx );

					dy = v2 - my;
					my += dy / N;
					dyN = v2 - my;
					M2y += dy * dyN;

					C += dx * dyN;
				}
			}
		}
		// Case: neither the current co-moment nor the incoming values are NaN, so we need to update the accumulated values...
		else if ( isnan( C ) === false ) {
			dx0 = buf[ i ] - mx;
			dy0 = buf[ i+1 ] - my;
			dxN = x - mx;
			dyN = y - my;
			dx = dxN - dx0;
			dy = dyN - dy0;
			mx += dx / W;
			my += dy / W;
			M2x += dx * ( dx0+(x-mx) );
			M2y += dy * ( dy0+(y-my) );
			C += (dxN*dyN) - (dx0*dy0) - ( dx*dy/W );
		}
		// Case: the current co-moment is NaN, so nothing to do until the buffer no longer contains NaN values...
		buf[ i ] = x;
		buf[ i+1 ] = y;

		sx = sqrt( M2x/n );
		sy = sqrt( M2y/n );
		return ( C/n ) / ( sx*sy ); // Note: why all the dividing by `n`? To avoid overflow.
	}
If provided a value, the accumulator function returns an updated sample correlation coefficient. If not provided a value, the accumulator function returns the current sample correlation coefficient.

@private
@param {number} [x] - input value
@param {number} [y] - input value
@returns {(number|null)} sample correlation coefficient or null