function accumulator( x ) {
		var k;
		var v;
		if ( arguments.length === 0 ) {
			if ( N === 0 ) {
				return null;
			}
			return prod;
		}
		// Update the index for managing the circular buffer:
		i = (i+1) % W;

		// Case: incoming value is NaN, the accumulated value is automatically NaN...
		if ( isnan( x ) ) {
			N = W; // explicitly set to avoid `N < W` branch
			prod = NaN;
		}
		// Case: initial window...
		else if ( N < W ) {
			N += 1;
			prod = product( parts, acc, x );
		}
		// Case: outgoing value is a "special" value, and, thus, we need to compute the accumulated value...
		else if (
			buf[ i ] === 0.0 ||
			isnan( buf[ i ] ) ||
			isInfinite( buf[ i ] )
		) {
			N = 1;
			acc.frac = 0.5;
			acc.exp = 1.0;
			product( parts, acc, x );
			for ( k = 0; k < W; k++ ) {
				if ( k !== i ) {
					v = buf[ k ];
					if ( isnan( v ) ) {
						N = W; // explicitly set to avoid `N < W` branch
						prod = NaN;
						break; // product is automatically NaN, so no need to continue
					}
					N += 1;
					prod = product( parts, acc, v );
				}
			}
		}
		// Case: neither the current accumulated value nor the incoming value are NaN, so we need to update the accumulated value...
		else if ( isnan( prod ) === false ) {
			v = x / buf[ i ];
			prod = product( parts, acc, v );
		}
		// Case: the current accumulated value is NaN, so nothing to do until the buffer no longer contains NaN values...
		buf[ i ] = x;

		return prod;
	}
If provided a value, the accumulator function returns an updated product. If not provided a value, the accumulator function returns the current product.

@private
@param {number} [x] - input value
@returns {(number|null)} product or null