1. Carry out calculations similar to those of Example 1.3 for approximating the derivative of the function f(x)=e-2x eva
-
- Site Admin
- Posts: 899559
- Joined: Mon Aug 02, 2021 8:13 am
1. Carry out calculations similar to those of Example 1.3 for approximating the derivative of the function f(x)=e-2x eva
Example 1.3. The numbers in Example 1.2 might suggest that an arbitrary accuracy can be achieved by the algorithm, provided only that we take h small enough. Indeed, suppose we want cos(1.2) sin(1.2+h) – sin(1.2) h < 10-10 Can't we just set h < 10-10/0.466 in our algorithm? Not quite! Let us record results for very small, positive values of h: h Absolute error 1.e-8 4.361050e-10 1.e-9 5.594726e-8 1.e-10 1.669696e-7 1.e-11 7.938531e-6 1.e-13 4.250484e-4 1.e-15 8.173146e-2 1.e-16 3.623578e-1
10° 10-5 Absolute error 10-10 10-15 10 20 10015 1070 105 10° h Figure 1.3. The combined effect of discretization and roundoff errors. The solid curve interpolates the computed values of f'(xo) – f(xo+h) – f(xo) |for f(x)=sin(x), xo = 1.2. Also shown in dash-dot style is a straight line depicting the discretization error without roundoff error.