This formula is used for (2n + 1) odd equispaced arguments and the value is to be tabulated near the middle point of those arguments. This interpolation is obtained by considering the arithmetic mean of Gauss’s forward and backward interpolation for odd (2n+1) arguments.
DERIVATION
The formula of Stirling’s interpolation is:
GRAPHICAL REPRESENTATION
INPUT:
The values of x and f(x)
OUTPUT:
The f(x) after calculating the value of specified x
PROCESS:
Step 1: [Taking the values of x and f(x)]
Read n [number of given terms]
for i = 0 to n - 1 repeat
Read x[i], y[i]
[End of for loop]
Read x1 [value for which f(x) is to be calculated]
Step 2: [Stirling interpolation]
Set h ← x[1] - x[0]
Set s ← n / 2
Set a ← x[s]
Set u ← (x1 - a) / h
for i = 0 to n – 2 repeat
Set del[i][0] ← y[i + 1] - y[i]
[End of ‘for’ loop]
for i = 1 to n – 2 repeat
for j = 0 to n - i –2 repeat
Set del[j][i] ← del[j + 1][i - 1] - del[j][i - 1]
[End of ‘for’ loop]
[End of ‘for’ loop]
Set y1 ← y[s]
for i = 1 to n – 1 repeat
if i mod 2 ≠ 0) then
if k ≠ 2 then
Set t1 ← t1×(u^k-(k - 1)^2)
else
Set t1 ← t1 × (u^2 - (k - 1)^2)
[End of ‘if’]
Set k ← k + 1
Set d ← d × i
Set s ← (n - i) / 2
Set y1 ← y1 + ((t1 / (2 × d)) × (del[s][i - 1] + del[s - 1][i - 1]))
else
Set t2 ← t2 × (u^2- (l - 1)^2)
Set l ← l + 1
Set d ← d × i
Set s ← (n - i) / 2
Set y1 ← y1 + ((t2 / (d)) × (del[s][i - 1]))
[End of ‘if’]
[End of ‘for’ loop]
Print y1
[End of stirling interpolation]
ADVANTAGES
1. This formula decreases more rapidly than other formulas.
2. It gives better accuracy than the other formulas
3. This formula uses the function values of both sides of the function f(x)
DISADVANTAGES
1. This method is only applicable if there is a uniform difference between two consecutive x.
APPLICATION
1. It is used when the interpolating point x is near the center of the table and the number of arguments is odd.
2. It is more suitable if the difference table ends with odd order differences, it gives a more accurate result.
3. This formula is more appropriate if the starting point is chosen so that the value of u lies between -.25 to +.25 or |u| < .25 = 1/4.
Contributed by