逆数補間の計算方法について
こんにちは。前にも書かせてもらいましたが、どうしても計算ができないので、もう一度質問させてもらいました。
以下のような、洋書を読んで、最後にあるP(y)を出したいのですが、計算方法がわかりません。
----------------------------------------------------------------
[Inverse Interpolation]
A process called inverse interpolation is often used to approximate an inverse function. Suppose that values {Yi}=f({Xi}) have been computed at X0,X1,...,Xn.
Using table
Y ; Y0 Y1 Y2 ......Yn
X ; X0 X1 X2 ......Xn
we form the interpolation polynomial
p(y)=Σ(i=1→n)CiΠ(j=0→i-1){Y-Yj}
The orijinal relationship, y=f(x), has an inverse, under certain conditions. This inverse is being approximated by x=p(y). Procedures Coef and Eval can be used to carry out the inverse interpolation by reversing the arguments x and y in the calling sequence for Coef.
Inverse interpolation can be used to find where a given functuin f has a root or zero. This means inverting the equation f(x)=0. We propose to do this by creating a table of values (f(Xi),Xi) and interpolating with a polynomial,p. Thus, p(Yi)=Xi. The points Xi should be chosen near the unknown root,r. The approximate root is then given by r ~p(0). For a concrete case, let the table of known values be
Y;-0.5789200,-0.3626370,-0.1849160,-0.0340642,0.0969858
X; 1.0 , 2.0 , 3.0 , 4.0 , 5.0
The nodes in this problem are the points in the row of the table headed y, and the function values being interpolated are in the x row. The resulting polynomial is
p(Y)=0.25Y^4+1.2Y^3+3.69Y^2+7.39Y+4.247470086
and p(0)=4.247470086. Only the last coefficient is shown with all the digits carried in the calculation, for it is the only one needed for the problem at hand.
----------------------------------------------------------------
<補足>CoefとEvalについて
「 procedure; Coef(n,{Xi},{Yi},{Ai})
real array; {Xi}0:n, {Yi}0:n, {Ai}0:n
integer; i,j,n
for i=0 to n do
{Ai}←{Yi}
end for
for j=1 to n do
for i=n to j step -1 do
Ai←({Ai}-{Ai-1})/({Xi}-{Xi-j})
end for
end for
end procedure Coef 」
「 real function; Eval(n,{Xi},{Yi},{Ai})
real array; {Xi}0:n, {Ai}0:n
integer; i,n
real;t,temp
temp←An
for i=n-1 to 0 step -1 do
temp←(temp)(t-{Xi})+{Ai}
end for
Eval←temp
end function Eval」
-------------------------------------------------------------
XとYを扱い方がよくわかっていないので、計算できないのかなあと思います。分かる方、アドバイスお願いします(泣)