Basic Examples
Basic Examples
A rational interpolation of degree (2,4) to at seven equally spaced points between 0 and 2:
[E^x,{x,2,4},Range[0,2,1/3]]
In[]:=
1.+0.379962x+0.0469528x
2
1-0.620029x+0.166914x-0.0234058x+0.00145279x
2
3
4
Out[]=
The error between the function and the approximation tends to get larger near the endpoints:
Plot[%-E^x,{x,0,2},PlotRangeAll]
In[]:=
Out[]=
Automatically chosen the interpolation points: result in a smaller maximum error:
[E^x,{x,2,4},{x,0,2}]
In[]:=
1.+0.379827x+0.0468693x/1-0.620166x+0.166978x-0.0234119x+0.00145192x
2
2
3
4
Out[]=
Plot[%-E^x,{x,0,2}]
In[]:=
Out[]=
Options
Options
“Bias”
“Bias”
Bias the distribution of the points to the right to get smaller errors there and larger errors to the left:
[E^x,{x,2,4},{x,0,2},"Bias".25]
In[]:=
1.+0.386186x+0.0491526x
2
1-0.613792x+0.16282x-0.0223404x+0.0013436x
2
3
4
Out[]=
Plot[%-E^x,{x,0,2}]
In[]:=
Out[]=