Basic Examples (2)
Basic Examples
(2)
A rational interpolation of degree (2,4) to at seven equally spaced points between 0 and 2:
x
e
In[8]:=
Out[8]=
(1.+0.379962x+0.0469528)/(1-0.620029x+0.166914-0.0234058+0.00145279)
2
x
2
x
3
x
4
x
The error between the function and the approximation tends to get larger near the endpoints:
In[9]:=
Plot[%-E^x,{x,0,2},PlotRangeAll]
Out[9]=
———
Automatically choosing the interpolation points results in a smaller maximum error:
In[12]:=
Out[12]=
(1.+0.379827x+0.0468693)/(1-0.620166x+0.166978-0.0234119+0.00145192)
2
x
2
x
3
x
4
x
In[13]:=
Plot[%-E^x,{x,0,2}]
Out[13]=
Options (1)
Options
(1)