12    private const EPS = 2.22e-16;
 
   33            return $e->getMessage();
 
   72            return $e->getMessage();
 
   86        if ($cumulative === 
true) {
 
   90        return (($value ** (($degrees / 2) - 1) * exp(-$value / 2))) /
 
  113            return $e->getMessage();
 
  120        $callback = 
function ($value) use ($degrees) {
 
  127        return $newtonRaphson->execute($probability);
 
  149            return $e->getMessage();
 
  171    public static function test($actual, $expected)
 
  173        $rows = count($actual);
 
  178        $countActuals = count($actual);
 
  179        $countExpected = count($expected);
 
  180        if ($countActuals !== $countExpected || $countActuals === 1) {
 
  185        for (
$i = 0; 
$i < $countActuals; ++
$i) {
 
  186            if ($expected[
$i] == 0.0) {
 
  188            } elseif ($expected[
$i] < 0.0) {
 
  191            $result += (($actual[
$i] - $expected[
$i]) ** 2) / $expected[
$i];
 
  216        $sd = sqrt(2.0 * $degrees);
 
  220        while (
$s * self::pchisq($max, $degrees) > $probability * 
$s) {
 
  226        $chi2 = 0.5 * ($min + $max);
 
  228        while (($max - $min) > self::EPS * $chi2) {
 
  229            if (
$s * self::pchisq($chi2, $degrees) > $probability * 
$s) {
 
  234            $chi2 = 0.5 * ($min + $max);
 
  240    private static function pchisq($chi2, $degrees)
 
  247        if (
$x < 0.5 * 
$n + 1) {
 
  265        for (
$i = 1; 
$i < 101; ++
$i) {
 
  267            $del = $del * 
$x / $ap;
 
  269            if ($del < $sum * self::EPS) {
 
  274        return $sum * exp(-
$x + $a * log(
$x) - $gln);
 
  290        for (
$i = 1; 
$i < 101; ++
$i) {
 
  291            $an = -
$i * (
$i - $a);
 
  294            if (abs(
$d) < $fpmin) {
 
  298            if (abs(
$c) < $fpmin) {
 
  309        return $h * exp(-
$x + $a * log(
$x) - $gln);
 
An exception for terminatinating execution or to throw for unit testing.
const COMPATIBILITY_GNUMERIC
static flattenArray($array)
Convert a multi-dimensional array to a simple 1-dimensional array.
static flattenSingleValue($value='')
Convert an array to a single scalar value by extracting the first element.
static getCompatibilityMode()
Return the current Compatibility Mode.
static test($actual, $expected)
CHITEST.
static distributionLeftTail($value, $degrees, $cumulative)
CHIDIST.
static inverseLeftTailCalculation(float $probability, int $degrees)
static degrees(int $rows, int $columns)
static inverseRightTail($probability, $degrees)
CHIINV.
static inverseLeftTail($probability, $degrees)
CHIINV.
static pchisq($chi2, $degrees)
static distributionRightTail($value, $degrees)
CHIDIST.
static validateProbability($probability)
static gammaValue(float $value)
static incompleteGamma(float $a, float $x)
static ln($value)
GAMMALN.
static validateFloat($value)
static validateBool($value)
static validateInt($value)
for( $i=6;$i< 13;$i++) for($i=1; $i< 13; $i++) $d