<commit_before>'use strict';

// MODULES //

var betaincinv = require( '@stdlib/math/base/special/betaincinv' );
var isnan = require( '@stdlib/math/base/utils/is-nan' );
var nan = require( './nan.js' );


// MAIN //

/**
* Returns a function for evaluating the quantile function for a beta distribution with first shape parameter `alpha` and second shape parameter `beta`.
*
* @param {PositiveNumber} alpha - first shape parameter
* @param {PositiveNumber} beta - second shape parameter
* @returns {Function} quantile function
*
* @example
* var quantile = factory( 2.5, 0.5 );
* var y = quantile( 0.5 );
* // returns ~0.904
*
* y = quantile( 0.8 );
* // returns ~0.986
*/
function factory( alpha, beta ) {
	if ( isnan( alpha ) || isnan( beta ) ) {
		return nan;
	}
	if ( alpha <= 0.0 || beta <= 0.0 ) {
		return nan;
	}
	return quantile;

	/**
	* Evaluates the quantile function for a beta distribution.
	*
	* @private
	* @param {Probability} p - input value
	* @returns {number} evaluated quantile function
	*
	* @example
	* var y = quantile( 0.3 );
	* // returns <number>
	*/
	function quantile( p ) {
		if ( isnan( p ) ) {
			return NaN;
		}
		if ( p < 0.0 || p > 1.0 ) {
			return NaN;
		}
		return betaincinv( p, alpha, beta );
	}; // end FUNCTION quantile()
} // end FUNCTION factory()


// EXPORTS //

module.exports = factory;<commit_msg>Remove semicolon<commit_after>'use strict';

// MODULES //

var betaincinv = require( '@stdlib/math/base/special/betaincinv' );
var isnan = require( '@stdlib/math/base/utils/is-nan' );
var nan = require( './nan.js' );


// MAIN //

/**
* Returns a function for evaluating the quantile function for a beta distribution with first shape parameter `alpha` and second shape parameter `beta`.
*
* @param {PositiveNumber} alpha - first shape parameter
* @param {PositiveNumber} beta - second shape parameter
* @returns {Function} quantile function
*
* @example
* var quantile = factory( 2.5, 0.5 );
* var y = quantile( 0.5 );
* // returns ~0.904
*
* y = quantile( 0.8 );
* // returns ~0.986
*/
function factory( alpha, beta ) {
	if ( isnan( alpha ) || isnan( beta ) ) {
		return nan;
	}
	if ( alpha <= 0.0 || beta <= 0.0 ) {
		return nan;
	}
	return quantile;

	/**
	* Evaluates the quantile function for a beta distribution.
	*
	* @private
	* @param {Probability} p - input value
	* @returns {number} evaluated quantile function
	*
	* @example
	* var y = quantile( 0.3 );
	* // returns <number>
	*/
	function quantile( p ) {
		if ( isnan( p ) ) {
			return NaN;
		}
		if ( p < 0.0 || p > 1.0 ) {
			return NaN;
		}
		return betaincinv( p, alpha, beta );
	} // end FUNCTION quantile()
} // end FUNCTION factory()


// EXPORTS //

module.exports = factory;
{'fraction_non_alphanumeric': 0.15689910979228486, 'fraction_numerical': 0.019287833827893175, 'mean_word_length': 3.013392857142857, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3316526', 'n_tokens_mistral': 1000, 'n_tokens_neox': 934, 'n_words': 292}