1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
// PG (150)
X = [2.0,2.1,2.2,2.3,2.4]
X1 = X(1,1)
X2 = X(1,2)
X3 = X(1,3)
X4 = X(1,4)
X5 = X(1,5)
deff('[y]=f(x)','y=sqrt(x)')
Y = [f(X1) f(X2) f(X3) f(X4) f(X5)]
Y1 = Y(1,1)
Y2 = Y(1,2)
Y3 = Y(1,3)
Y4 = Y(1,4)
Y5 = Y(1,5)
// Difference
// f[X1,X2]
(f(X2) - f(X1))
// f[X2,X3]
(f(X3) - f(X2))
// f[X3,X4]
(f(X4) - f(X3))
// f[X4,X5]
(f(X5) - f(X4))
// D^2 * f[Xi]
((f(X3)-f(X2)) - (f(X2)-f(X1)))
((f(X4)-f(X3)) - (f(X3)-f(X2)))
((f(X5)-f(X4)) - (f(X4)-f(X3)))
// D^3 * f[Xi]
((f(X4)-f(X3)) - (f(X3)-f(X2))) - ((f(X3)-f(X2)) - (f(X2)-f(X1)))
((f(X5)-f(X4)) - (f(X4)-f(X3))) - ((f(X4)-f(X3)) - (f(X3)-f(X2)))
// D^4 * f[Xi]
(((f(X5)-f(X4)) - (f(X4)-f(X3))) - ((f(X4)-f(X3)) - (f(X3)-f(X2)))) - (((f(X4)-f(X3)) - (f(X3)-f(X2))) - ((f(X3)-f(X2)) - (f(X2)-f(X1))))
mu = 1.5;
x = 2.15;
p1 = f(X1) + mu * (f(X2) - f(X1))
p2 = p1 + mu*(mu-1)*((f(X3)-f(X2)) - (f(X2)-f(X1)))/2
// Similarly, p3 = 1.466288
// p4 = 1.466288
|