NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist · #1945 most downloaded on Packagist
Math Library for PHP. Features descriptive statistics and regressions; Continuous and discrete probability distributions; Linear algebra with matrices and vectors, Numerical analysis; special mathematical functions; Algebra
Last release 11 months ago
24 Oct 2025
Release timing varies
gaps range from 2 weeks to 10 months
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
10 years old
140 releases · first in 2016
Refactor ChiSquared pdf to avoid raising 0 to negative exponent which is deprecated
columnAddScalarcolumnSubtractcolumnSubtractScalarcolumnDividegetShoeSize has a typo and was getShowSize. This has been fixed.cdf. Implementation changed to use sum of PMFs.sampleCovariance, populationCorrelationCoefficient, sampleCorrelationCoefficient, throw BadDataException or OutOfBoundsException rather than division by zero for bad input data.coefficientOfVariation will return NAN if mean is zero. Previously did division by zero.hellinger, brayCurtis, and canberra that could have resulted in incorrect results.cohensQ bounds check [-1, 1] and throw OutOfBoundsException when outside range, and return INF when r == 1 or -1.hedgesG, cohensD, and glassDelta.medianfractionalRanking to track original indices and use == for tie detection instead of strval() grouping, avoiding floating-point comparison bugs.cumulativeFrequency and cumulativeRelativeFrequency now do a frequency distribution on sorted data, which was the original intent.kullbackLeibler and jensenShannon throw an exception if there are non-negative probabilities.stemAndLeafPlot throws an exception if there are negative values.likelihoodRatioSS returns infinity for rather than division by zero.grubbsCriticalValue.checkLimits to add invalid endpoint character in the exception messageOne column per quarter.
Matrix Hessenberg decomposition
isProperSubset where it didn't take into account identical setsisProperSubset where it didn't take into account identical setsMinor changes for PHP 8.4 compatibility
New Features NumberTheory\Integer isPrime
isPrimeInternal build CI/CD improvements
chebyshevInternal improvements to improve conformance with static analysis tools
Better error handling and exception message in Sequence\NonIntenger::hyperharmonic
rowAddVectorcolumnAddVectorSequence\NonIntenger::hyperharmonicNumericalDifferentiation::isTargetInPoints changed to assertTargetInPointsNumericalDifferentiation::isSpacingConstant changed to assertSpacingConstantImproved algorithm for regularizedIncompleteBeta : Addresses issue 458
regularizedIncompleteBeta: Addresses issue 458Average::truncatedMean behavior at 50% trim made consistent
Average::truncatedMean behavior at 50% trim made consistentAverage::truncatedMean throws exception if trim percent greater than 50% rather than error or unpredictable results.Improvements in StudentT continuous distribution
logbetalogGammalogGammaCorrstirlingErrorgammabetaZipf's Law Discrete Distribution
exp)pow)polarForm to compute the right valueshyperharnomic non-integer sequence. Previously was computing the wrong thingArbitraryInterger handles pow of negative exponentspolarForm now returns an array rather than a Complex number, as the Complex return was incorrecthyperharmonic non-integer sequence changed due to previous implementation being incorrectMatrix SVD (Singular Value Decomposition)
PLS (Partial Least Squares Regression)
__debugInfo to NumericMatrix### New Features * Quaternion numbers
walk method to map a function to all values without mutation or returning a value
walk method to map a function to all values without mutation or returning a valueMatrixFactory creates more matrix typesMatrixFactory::createNumeric to create NumericMatrix typesMatrixFactory::createFromRowVectorMatrixFactory::createFromColumnVectorObjectMatrix improvements
tracescalarMultiplyComplexMatrixBugfix (Issue 413): Matrix solve with singular matrix using RREF
Bugfix (Issue 356): Fix Finance IRR NANs
Arithmetic isqrt (integer square root)
Improve permutations algorithm to be more efficient and more numerically stable
Algebra linear equation of one variable
Special function regularized lower incomplete gamma
Bugfix (Issue 386) Matrix solve improvements
Legacy Distance divergences marked as deprecated (To be removed in v2.0.0)
Minkowski distance of two vectors
(Issue 380) Fixed Spearman's Rho calculation when there are rank ties
Improved matrix multiplication performance using cache-oblivious algorithm optimization
Initial version 1.0.0 release!
Initial version 1.0.0 release!
### Improvements - Internal improvements
Multivariate Hypergeometric distribution
### New Features - Sample Data - MtCars - Iris - ToothGrowth - PlantGrowth - UsArrests
Add population and sample kurtosis
Changed default skewness algorithm to the more common sample skewness
Set Theory n-ary Cartesian product
Optimization of prime factorization algorithm
### New Features - Arbitrary length integers ### Improvements - Factorial optimization
MatrixFactory random matrix custom lower and upper bounds for random number
Matrix QR decomposition using Householder reflections
Grubb's test for statistical outliers
MatrixFactory diagonal matrix creation method
Support methods for almost equal
### New Features - Matrix augmentAbove - Matrix augmentLeft ### Improvements - Object matrix multiplication
Bernoulli distribution mean, median, mode and variance
Beta distribution median, mode, variance
Improve README documentation for continuous distributions
Add Beta distribution inverse quantile function
[[Issue 271]](https://github.com/markrogoyski/math-php/issues/271) Improvements to documentation
### New Features * Arithmetic copySign * Matrix negate * Matrix isSkewSymmetric
Weighted correlation coefficient
Statistics\Average::mode improved to work with non-integer values
Simpler interface for Significance `tTest` for one and two samples
tTest for one and two samplesUpgrade unit testing framework to PHPUnit 6
Percentile reimplemented to use linear interpolation between closest ranks method - Second variant, C = 1
Change probability distributions to be objects instead of static methods
### New Features * Rational number * Gamma distribution mean ### Improvements * Add .gitignore file
Matrix getSuperdiagonalElements
Multivariate normal distribution
### New Features - Kernel density estimation
Categorical discrete distribution
### New Features * Hypergeometric distribution * Discrete uniform distribution
Dirichlet multivariate distribution
Your coding agent can read these notes before it upgrades. Set up the MCP server →