Private Sub Command1_Click()
'PROGRAM D2R2
'DRIVER for routine RATINT
NPT = 6
Dim X(6), Y(6)
For I = 1 To NPT
X(I) = I * 2# / NPT
Y(I) = FUNC(X(I))
Next I
Print
Print Tab(5); "Diagonal rational function interpolation"
Print Tab(5); " x interap. accuracy actual"
For I = 1 To 10
XX = 0.2 * I
Call RATINT(X(), Y(), NPT, XX, YY, DYY)
YEXP = FUNC(XX)
Print Tab(5); Format$(XX, "#.#0");
Print Tab(13); Format$(YY, ".####00");
Print Tab(25); Format$(DYY, ".0000E+00");
Print Tab(40); Format$(YEXP, ".######")
Next I
End Sub
Function FUNC(X)
FUNC = X * Exp(-X) / ((X - 1#) ^ 2 + 1#)
End Function