Convergence of PL interpolation¶
We measure the convergence rate for piecewise linear interpolation of \(e^{\sin 7x}\).
n | error |
---|---|
Int64 | Float64 |
8 | 0.21602990323384974 |
16 | 0.06381730414968168 |
32 | 0.016038182942837764 |
64 | 0.004058789402869412 |
128 | 0.0010155253347479132 |
256 | 0.0002540280995928512 |
512 | 6.348972346570392e-5 |
1024 | 1.5876989992058554e-5 |
Since we expect convergence that is \(O(h^2)=O(n^{-2})\), we use a log-log graph of error and expect a straight line of slope \(-2\).