function accumulate3d( x, initial, clbk ) {
	var xbuf;
	var get;
	var dx0;
	var dx1;
	var dx2;
	var acc;
	var sh;
	var S0;
	var S1;
	var S2;
	var sx;
	var ix;
	var i0;
	var i1;
	var i2;

	// Note on variable naming convention: S#, dx#, i# where # corresponds to the loop number, with `0` being the innermost loop...

	// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...
	sh = x.shape;
	sx = x.strides;
	if ( strides2order( sx ) === 1 ) {
		// For row-major ndarrays, the last dimensions have the fastest changing indices...
		S0 = sh[ 2 ];
		S1 = sh[ 1 ];
		S2 = sh[ 0 ];
		dx0 = sx[ 2 ];                // offset increment for innermost loop
		dx1 = sx[ 1 ] - ( S0*sx[2] );
		dx2 = sx[ 0 ] - ( S1*sx[1] ); // offset increment for outermost loop
	} else { // order === 'column-major'
		// For column-major ndarrays, the first dimensions have the fastest changing indices...
		S0 = sh[ 0 ];
		S1 = sh[ 1 ];
		S2 = sh[ 2 ];
		dx0 = sx[ 0 ];                // offset increment for innermost loop
		dx1 = sx[ 1 ] - ( S0*sx[0] );
		dx2 = sx[ 2 ] - ( S1*sx[1] ); // offset increment for outermost loop
	}
	// Set the pointer to the first indexed element:
	ix = x.offset;

	// Cache a reference to the input ndarray buffer:
	xbuf = x.data;

	// Cache a reference to the accessor:
	get = x.accessors[ 0 ];

	// Initialize the accumulator:
	acc = initial;

	// Iterate over the ndarray dimensions...
	for ( i2 = 0; i2 < S2; i2++ ) {
		for ( i1 = 0; i1 < S1; i1++ ) {
			for ( i0 = 0; i0 < S0; i0++ ) {
				acc = clbk( acc, get( xbuf, ix ) ); // eslint-disable-line node/callback-return
				ix += dx0;
			}
			ix += dx1;
		}
		ix += dx2;
	}
	return acc;
}
Performs a reduction over elements in a three-dimensional input ndarray.

@private
@param {Object} x - object containing input ndarray meta data
@param {string} x.dtype - data type
@param {Collection} x.data - data buffer
@param {NonNegativeIntegerArray} x.shape - dimensions
@param {IntegerArray} x.strides - stride lengths
@param {NonNegativeInteger} x.offset - index offset
@param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)
@param {Array<Function>} x.accessors - data buffer accessors
@param {*} initial - initial value
@param {Callback} clbk - callback function
@returns {*} result

@example
var Complex64Array = require( '@stdlib/array/complex64' );
var Complex64 = require( '@stdlib/complex/float32/ctor' );
var realf = require( '@stdlib/complex/float32/real' );
var imagf = require( '@stdlib/complex/float32/imag' );

function add( acc, z ) {
    return new Complex64( realf(acc)+realf(z), imagf(acc)+imagf(z) );
}

// Create a data buffer:
var xbuf = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );

// Define the shape of the input array:
var shape = [ 1, 2, 2 ];

// Define the array strides:
var sx = [ 4, 2, 1 ];

// Define the index offset:
var ox = 0;

// Define getters and setters:
function getter( buf, idx ) {
    return buf.get( idx );
}

function setter( buf, idx, value ) {
    buf.set( value, idx );
}

// Create the input ndarray-like object:
var x = {
    'dtype': 'complex64',
    'data': xbuf,
    'shape': shape,
    'strides': sx,
    'offset': ox,
    'order': 'row-major',
    'accessors': [ getter, setter ]
};

// Compute the sum:
var v = accumulate3d( x, new Complex64( 0.0, 0.0 ), add );
// returns <Complex64>

var re = realf( v );
// returns 16.0

var im = imagf( v );
// returns 20.0