blob: 74e3c37bc447963a4952a662bd7bce91c8720e2a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
//Example No. 4_14
//Absolute & Relative Errors
//Pg No. 79
clear ; close ; clc ;
xa = 4.000
deff('f = f(x)','f = sqrt(x) + x')
//Assuming x is correct to 4 significant digits
ex = 0.5 * 10^(-4 + 1)
df_xa = derivative(f,4)
ef = ex * df_xa
er_f = ef/f(xa)
mprintf('\n ex = %.0E \n df(xa) = %.2f \n ef = %.2E \n er,f = %.2E \n', ex,df_xa,ef,er_f)
|