function entropy( p ) {
	var q;
	if (
		isnan( p ) ||
		p < 0.0 ||
		p > 1.0
	) {
		return NaN;
	}
	if ( p === 0.0 || p === 1.0 ) {
		return 0.0;
	}
	q = 1.0 - p;
	return ( -q * ln( q ) ) - ( p * ln( p ) );
}
Returns the entropy of a Bernoulli distribution.

@param {Probability} p - success probability
@returns {PositiveNumber} entropy

@example
var v = entropy( 0.1 );
// returns ~0.325

@example
var v = entropy( 0.5 );
// returns ~0.693

@example
var v = entropy( 0.9 );
// returns ~0.325

@example
var v = entropy( 1.1 );
// returns NaN

@example
var v = entropy( NaN );
// returns NaN