MathPHP\Statistics\Average::identricMean PHP Метод

identricMean() публичный статический Метод

Identric mean https://en.wikipedia.org/wiki/Identric_mean ____ 1 / xˣ I(x,y) = - ˣ⁻ʸ/ -- ℯ √ yʸ
public static identricMean ( number $x, number $y ) : number
$x number
$y number
Результат number
    public static function identricMean($x, $y)
    {
        // x and y must be positive
        if ($x <= 0 || $y <= 0) {
            throw new Exception\OutOfBoundsException('x and y must be positive real numbers.');
        }
        // Special case: x if x = y
        if ($x == $y) {
            return $x;
        }
        // Standard case
        $ℯ = \M_E;
        $xˣ = $x ** $x;
        $yʸ = $y ** $y;
        return 1 / $ℯ * pow($xˣ / $yʸ, 1 / ($x - $y));
    }