← Polynomial Regression comparison

How fast do the two scaled fitters get slow?

Time to fit one polynomial, for simple (scaled) (normal equations accumulated as running moments — no matrix) and forsythe (discrete orthogonal polynomials, no linear solve) — across dataset sizes from 8 to 1 million points, polynomial degrees 1–6, and three realistic data shapes, in all three major JavaScript engine families. (The stable QR method is left out: forsythe matches its accuracy while running several times faster, so it's strictly the better of the two robust fitters.) Degrees past a handful overfit noisy data (and higher-degree fits are a numerical-stability topic of their own), so this sticks to the range you'd actually fit; both methods stay accurate throughout, making it a clean speed comparison. Lower is better; axes are logarithmic.

Data: tools/perf-grid-results-<engine>.json · regenerate with tools/run-perf-grid-engines.sh · times are the minimum over repeated calls (the reproducible floor; medians are in the table below).

Loading results…