function linspace( start, stop, out ) {
	var opts;
	var err;
	var dt1;
	var dt2;
	var flg;
	var odt;
	var o;

	if ( typeof start === 'object' ) {
		dt1 = dtype( start );
		if ( dt1 === null ) {
			if ( !isComplexLike( start ) ) {
				throw new TypeError( format( 'invalid argument. First argument must be either a real or complex number. Value: `%s`.', start ) );
			}
			dt1 = 'complex128';
		}
		flg = true;
	} else if ( !isNumber( start ) || isnan( start ) ) {
		throw new TypeError( format( 'invalid argument. First argument must be either a real or complex number. Value: `%s`.', start ) );
	} else {
		dt1 = 'float64';
	}
	if ( typeof stop === 'object' ) {
		dt2 = dtype( stop );
		if ( dt2 === null ) {
			if ( !isComplexLike( stop ) ) {
				throw new TypeError( format( 'invalid argument. Second argument must be either a real or complex number. Value: `%s`.', stop ) );
			}
			dt2 = 'complex128';
		}
		flg = true;
	} else if ( !isNumber( stop ) || isnan( stop ) ) {
		throw new TypeError( format( 'invalid argument. Second argument must be either a real or complex number. Value: `%s`.', stop ) );
	} else {
		dt2 = 'float64';
	}
	if ( !isCollection( out ) ) {
		throw new TypeError( format( 'invalid argument. Third argument must be an array-like object. Value: `%s`.', out ) );
	}
	opts = {
		'endpoint': defaults.endpoint
	};
	if ( arguments.length > 3 ) {
		err = validate( opts, arguments[ 3 ] );
		if ( err ) {
			throw err;
		}
	}
	odt = adtype( out );
	if ( odt === null ) {
		odt = 'generic';
	}
	if ( odt === 'complex64' ) {
		typedcmplx( reinterpret64( out, 0 ), dt1, start, dt2, stop, out.length, opts.endpoint ); // eslint-disable-line max-len
		return out;
	}
	if ( odt === 'complex128' ) {
		typedcmplx( reinterpret128( out, 0 ), dt1, start, dt2, stop, out.length, opts.endpoint ); // eslint-disable-line max-len
		return out;
	}
	if ( flg ) {
		if ( odt === 'generic' ) {
			o = arraylike2object( out );
			acccmplx( o, dt1, start, dt2, stop, out.length, opts.endpoint );
			return out;
		}
		throw new TypeError( 'invalid arguments. If either of the first two arguments are complex numbers, the output array must be a complex number array or a "generic" array-like object.' );
	}
	o = arraylike2object( out );
	if ( o.accessorProtocol ) {
		accreal( o, start, stop, out.length, opts.endpoint );
		return out;
	}
	typedreal( out, start, stop, out.length, opts.endpoint );
	return out;
}
Generates a linearly spaced sequence over a specified interval and assigns the results to a provided output array.

@param {(number|ComplexLike)} start - start of interval
@param {(number|ComplexLike)} stop - end of interval
@param {Collection} out - output array
@param {Options} [options] - options
@param {boolean} [options.endpoint=true] - boolean indicating whether to include the `stop` value in the output array
@throws {TypeError} first argument must be either a real or complex number
@throws {TypeError} second argument must be either a real or complex number
@throws {TypeError} third argument must be an array-like object
@throws {TypeError} last argument must be an object
@throws {TypeError} must provide valid options
@throws {TypeError} the output array data type must be a complex number data type or "generic" when either `start` or `stop` is a complex number
@returns {Collection} output array

@example
var Float64Array = require( '@stdlib/array/float64' );

var out = new Float64Array( 6 );
var arr = linspace( 0, 100, out );
// returns <Float64Array>[ 0.0, 20.0, 40.0, 60.0, 80.0, 100.0 ]