"base.epsdiff": "\nbase.epsdiff( x, y[, scale] )\n Computes the relative difference of two real numbers in units of double-\n precision floating-point epsilon.\n\n By default, the function scales the absolute difference by dividing the\n absolute difference by the maximum absolute value of `x` and `y`. To scale\n by a different function, specify a scale function name.\n\n The following `scale` functions are supported:\n\n - 'max-abs': maximum absolute value of `x` and `y` (default).\n - 'max': maximum value of `x` and `y`.\n - 'min-abs': minimum absolute value of `x` and `y`.\n - 'min': minimum value of `x` and `y`.\n - 'mean-abs': arithmetic mean of the absolute values of `x` and `y`.\n - 'mean': arithmetic mean of `x` and `y`.\n - 'x': `x` (*noncommutative*).\n - 'y': `y` (*noncommutative*).\n\n To use a custom scale function, provide a function which accepts two numeric\n arguments `x` and `y`.\n\n If computing the relative difference in units of epsilon will result in\n overflow, the function returns the maximum double-precision floating-point\n number.\n\n If the absolute difference of `x` and `y` is `0`, the relative difference is\n always `0`.\n\n If `|x| = |y| = infinity`, the function returns `NaN`.\n\n If `|x| = |-y| = infinity`, the relative difference is `+infinity`.\n\n If a `scale` function returns `0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n First number.\n\n y: number\n Second number.\n\n scale: string|Function (optional)\n Scale function. Default: `'max-abs'`.\n\n Returns\n -------\n out: number\n Relative difference in units of double-precision floating-point epsilon.\n\n Examples\n --------\n > var d = base.epsdiff( 12.15, 12.149999999999999 )\n ~0.658\n > d = base.epsdiff( 2.4341309458983933, 2.4341309458633909, 'mean-abs' )\n ~64761.512\n\n // Custom scale function:\n > function scale( x, y ) { return ( x > y ) ? y : x; };\n > d = base.epsdiff( 1.0000000000000002, 1.0000000000000100, scale )\n ~44\n\n See Also\n --------\n base.absdiff, base.reldiff\n",
0 commit comments