/* harmony default export */

/* harmony import */

/*#__PURE__*/

/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/**
* A learning component illustrating conditional probability for two dependent binary variables.
*
* @property {string} A - first variable
* @property {string} B - second variable
*/

/**
* Compute the relative difference in units of double-precision floating-point epsilon.
*
* @module @stdlib/math/base/utils/float64-epsilon-difference
*
* @example
* var epsdiff = require( '@stdlib/math/base/utils/float64-epsilon-difference' );
*
* var d = epsdiff( 12.15, 12.149999999999999 ); // => ~0.658ε
* // returns ~0.658
*
* d = epsdiff( 2.4341309458983933, 2.4341309458633909, 'mean-abs' ); // => ~64761.5ε => ~1.438e-11
* // returns ~64761.5
*
* function scale( x, y ) {
*      // Return the minimum value:
*      return ( x > y ) ? y : x;
* }
*
* d = epsdiff( 1.0000000000000002, 1.0000000000000100, scale ); // => ~44ε
* // returns ~44
*/

/**
* Compute the relative difference of two real numbers.
*
* @module @stdlib/math/base/utils/relative-difference
*
* @example
* var reldiff = require( '@stdlib/math/base/utils/relative-difference' );
*
* var d = reldiff( 2.0, 5.0 ); // => 3/5
* // returns 0.6
*
* d = reldiff( -1.0, 3.14 ); // => 4.14/3.14
* // returns ~1.318
*
* d = reldiff( -2.0, 5.0, 'max-abs' ); // => |-7/5|
* // returns 1.4
*
* d = reldiff( -2.0, 5.0, 'max' ); // => |-7/5|
* // returns 1.4
*
* d = reldiff( -2.0, 5.0, 'min-abs' ); // => |-7/2|
* // returns 3.5
*
* d = reldiff( -2.0, 5.0, 'min' ); // => |-7/-2|
* // returns 3.5
*
* d = reldiff( -2.0, 5.0, 'mean-abs' ); // => |-7/3.5|
* // returns 2.0
*
* d = reldiff( -2.0, 5.0, 'mean' ); // => |-7/1.5|
* // returns ~4.67
*
* d = reldiff( -2.0, 5.0, 'x' ); // => |-7/-2|
* // returns 3.5
*
* d = reldiff( 5.0, -2.0, 'x' ); // => |7/5|
* // returns 1.4
*
* d = reldiff( -2.0, 5.0, 'y' ); // => |-7/5|
* // returns 1.4
*
* d = reldiff( 5.0, -2.0, 'y' ); // => |7/-2|
* // returns 3.5
*/

/**
* Computes the relative difference in units of double-precision floating-point epsilon.
*
* @param {number} x - first number
* @param {number} y - second number
* @param {(string|Function)} [scale='max-abs'] - scale function
* @returns {number} relative difference in units of double-precision floating-point epsilon
*
* @example
* var d = epsilonDifference( 12.15, 12.149999999999999 ); // => ~0.658ε
* // returns ~0.658
*
* @example
* var d = epsilonDifference( 2.4341309458983933, 2.4341309458633909, 'mean-abs' ); // => ~64761.5ε => ~1.438e-11
* // returns ~64761.5
*
* @example
* function scale( x, y ) {
*      // Return the minimum value:
*      return ( x > y ) ? y : x;
* }
*
* var d = epsilonDifference( 1.0000000000000002, 1.0000000000000100, scale ); // => ~44ε
* // returns ~44
*/

/**
* Computes the relative difference of two real numbers.
*
* @param {number} x - first number
* @param {number} y - second number
* @param {(string|Function)} [scale='max-abs'] - scale function
* @throws {Error} must provide a recognized scale function name
* @returns {number} relative difference
*
* @example
* var d = relativeDifference( 2.0, 5.0 ); // => 3/5
* // returns 0.6
*
* @example
* var d = relativeDifference( -1.0, 3.14 ); // => 4.14/3.14
* // returns ~1.318
*
* @example
* var d = relativeDifference( -2.0, 5.0, 'max-abs' ); // => |-7/5|
* // returns 1.4
*
* @example
* var d = relativeDifference( -2.0, 5.0, 'max' ); // => |-7/5|
* // returns 1.4
*
* @example
* var d = relativeDifference( -2.0, 5.0, 'min-abs' ); // => |-7/2|
* // returns 3.5
*
* @example
* var d = relativeDifference( -2.0, 5.0, 'min' ); // => |-7/-2|
* // returns 3.5
*
* @example
* var d = relativeDifference( -2.0, 5.0, 'mean-abs' ); // => |-7/3.5|
* // returns 2.0
*
* @example
* var d = relativeDifference( -2.0, 5.0, 'mean' ); // => |-7/1.5|
* // returns ~4.67
*
* @example
* var d = relativeDifference( -2.0, 5.0, 'x' ); // => |-7/-2|
* // returns 3.5
*
* @example
* var d = relativeDifference( 5.0, -2.0, 'x' ); // => |7/5|
* // returns 1.4
*
* @example
* var d = relativeDifference( -2.0, 5.0, 'y' ); // => |-7/5|
* // returns 1.4
*
* @example
* var d = relativeDifference( 5.0, -2.0, 'y' ); // => |7/-2|
* // returns 3.5
*/

/**
* Difference between one and the smallest value greater than one that can be represented as a double-precision floating-point number.
*
* ## Notes
*
* The difference is
*
* ```tex
* \frac{1}{2^{52}}
* ```
*
* @constant
* @type {number}
* @default 2.220446049250313e-16
* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}
* @see [Machine Epsilon]{@link https://en.wikipedia.org/wiki/Machine_epsilon}
*/

/**
* Difference between one and the smallest value greater than one that can be represented as a double-precision floating-point number.
*
* @module @stdlib/constants/math/float64-eps
* @type {number}
*
* @example
* var FLOAT64_EPSILON = require( '@stdlib/constants/math/float64-eps' );
* // returns 2.220446049250313e-16
*/

/**
* Maximum double-precision floating-point number.
*
* ## Notes
*
* The maximum is given by
*
* ```tex
* 2^{1023} (2 - 2^{-52})
* ```
*
* @constant
* @type {number}
* @default 1.7976931348623157e+308
* @see [IEEE 754]{@link http://en.wikipedia.org/wiki/IEEE_754-1985}
*/

/**
* Maximum double-precision floating-point number.
*
* @module @stdlib/constants/math/float64-max
* @type {number}
*
* @example
* var FLOAT64_MAX = require( '@stdlib/constants/math/float64-max' );
* // returns 1.7976931348623157e+308
*/

/**
* Return the minimum value.
*
* @module @stdlib/math/base/special/min
*
* @example
* var min = require( '@stdlib/math/base/special/min' );
*
* var v = min( 3.14, 4.2 );
* // returns 3.14
*
* v = min( 5.9, 3.14, 4.2 );
* // returns 3.14
*
* v = min( 3.14, NaN );
* // returns NaN
*
* v = min( +0.0, -0.0 );
* // returns -0.0
*/

/**
* Returns `x`.
*
* @private
* @param {number} x - first number
* @param {number} y - second number
* @returns {number} first number
*
* @example
* var z = f( 5.0, 3.14 );
* // returns 5.0
*/

/**
* Returns `y`.
*
* @private
* @param {number} x - first number
* @param {number} y - second number
* @returns {number} second number
*
* @example
* var z = f( 5.0, 3.14 );
* // returns 3.14
*/

/**
* Returns the arithmetic mean of `x` and `y`.
*
* @private
* @param {number} x - first number
* @param {number} y - second number
* @returns {number} arithmetic mean
*
* @example
* var z = mean( 3.5, 7.5 );
* // returns 5.5
*/

/**
* Returns the arithmetic mean of `|x|` and `|y|`.
*
* @private
* @param {number} x - first number
* @param {number} y - second number
* @returns {number} arithmetic mean
*
* @example
* var z = meanabs( -3.5, -7.5 );
* // returns 5.5
*/

/**
* Returns the maximum value of `x` and `y`.
*
* @private
* @param {number} x - first number
* @param {number} y - second number
* @returns {number} maximum value
*
* @example
* var z = max( 3.14, -1.0 );
* // returns 3.14
*/

/**
* Returns the maximum value of `|x|` and `|y|`.
*
* @private
* @param {number} x - first number
* @param {number} y - second number
* @returns {number} maximum absolute value
*
* @example
* var z = maxabs( 5.0, -11.11 );
* // returns 11.11
*/

/**
* Returns the minimum value of `x` and `y`.
*
* @private
* @param {number} x - first number
* @param {number} y - second number
* @returns {number} minimum value
*
* @example
* var z = min( 10.0, 3.14 );
* // returns 3.14
*/

/**
* Returns the minimum value of `|x|` and `|y|`.
*
* @private
* @param {number} x - first number
* @param {number} y - second number
* @returns {number} minimum absolute value value
*
* @example
* var z = minabs( -3.14, -11.0 );
* // returns 3.14
*/

/**
* Returns the minimum value.
*
* @param {number} [x] - first number
* @param {number} [y] - second number
* @param {...number} [args] - numbers
* @returns {number} minimum value
*
* @example
* var v = min( 3.14, 4.2 );
* // returns 3.14
*
* @example
* var v = min( 5.9, 3.14, 4.2 );
* // returns 3.14
*
* @example
* var v = min( 3.14, NaN );
* // returns NaN
*
* @example
* var v = min( +0.0, -0.0 );
* // returns -0.0
*/

/**
* Test if a double-precision floating-point numeric value is negative zero.
*
* @module @stdlib/math/base/assert/is-negative-zero
*
* @example
* var isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' );
*
* var bool = isNegativeZero( -0.0 );
* // returns true
*
* bool = isNegativeZero( 0.0 );
* // returns false
*/

/**
* Tests if a double-precision floating-point numeric value is negative zero.
*
* @param {number} x - value to test
* @returns {boolean} boolean indicating whether the value is negative zero
*
* @example
* var bool = isNegativeZero( -0.0 );
* // returns true
*
* @example
* var bool = isNegativeZero( 0.0 );
* // returns false
*/

/***/

// EXPORTS //

// If `d >= MAX_VALUE`, we will overflow, as `EPS <<< 1`. To prevent overflow, we cap out at the maximum double-precision floating-point number...

// If `d` is `NaN` or `+infinity`, nothing we can do...

// If the absolute difference is `0`, then so is the relative difference:

// MAIN //

// MODULES //

// PROPERTIES //

// doesn't account for +-0
