View Single Post
ahmed45

 
Member Since: Oct 01, 2010
Posts: 1
ahmed45 is on a distinguished road

ahmed45 is offline
hello..this is a general newton forward difference ccode..where and what will change for newtons forward DIVIDED difference?.
.program Divided_Differences_Iterpolation dimension x(20),y(20),d(20,20)
n=7
xx=.7
data (x(i), i=1,7) /0,.5,1,1.4,2,3.2,5.5/
data (y(i), i=1,7)/-1.25,-3.5,6,2.32,1.5,1.27,5.6/
s=y(1)
do i=1,n-1
do j=1,n-i
y(j)=(y(j+1)-y(j))/(x(j+i)-x(j))
d(i,j)=y(j) print*,d(i,j)
enddo
enddo
do i=1,n-1
p=1
do j=1,i p=p*(xx-x(j))
enddo
s=s+d(i,1)*p enddo print*,'Inte
rpolation of(',xx,')=',s
end

please ..a quick reply is needed..thank u
QUOTE Thanks