Loading
Stirling's formula interpolates near the middle of an equally spaced table, using central differences around the nearest point . It is the average of Gauss's forward and backward formulas.
From x = 1, 2, 3, 4, 5 and y = 1, 8, 27, 64, 125, estimate y at x = 3.2.
| x | y | Δy | Δ²y | Δ³y |
|---|---|---|---|---|
| 1 | 1 | 7 | 12 | 6 (Δ³y₋₂) |
| 2 | 8 | 19 (Δy₋₁) | 18 (Δ²y₋₁) | 6 (Δ³y₋₁) |
| 3 (x₀) | 27 (y₀) | 37 (Δy₀) | 24 | |
| 4 | 64 | 61 | ||
| 5 | 125 |
Stirling uses the entries that straddle the x₀ row: the odd differences just above and just below it (averaged), the even ones on it.
The differences around x₀: , , , .
The data come from , and exactly: with a cubic, the formula stops at Δ³ and is exact.
The calculator below opens on this table and tints the differences it used.
Using Stirling when x is halfway between rows.
Not averaging the odd differences.
Taking the even difference from the wrong row.
Wrong p-factors.
Choosing x₀ far from x.
Writing only the final answer.