MATLAB's polyfit function "finds the coefficients of a polynomial P(X) of degree N that fits the data Y best in a least-squares sense."
Prior to fitting, the function scales the independent variable, X, by subtracting its mean and dividing by its standard deviation:
XHAT = (X-MU(1))/MU(2) where MU(1) = MEAN(X) and MU(2) = STD(X).
The comment says: "This centering and scaling transformation improves the numerical properties of both the polynomial and the fitting algorithm."
Why does this scaling of the independent variable improve the numerical properties of the polynomial and fitting algorithm?