% x is a vector where x(i) = 10^(-i) % this file shows that "f1(x) = 1 + O(h^2)" % and "f2(x) = 0 + O(h^5)" c1 = 7; c2 = 3; format long e x = zeros(4,1); for i = 1:4 x(i) = 10^(-i); end % error of c1*f1(x)+c2*f2(x)-c1 record in a % error of f1(c1*x)+f2(c2*x)-1 record in b % According to the results , we can see that % "c1*f1(x)+c2*f2(x) = c1 + O(h^2)" %"f1(c1*x)+f2(c2*x) = 1 + O(h^2)" a = zeros(4,1); for j = 1:4 a(j) = c1*f1(x(j))+c2*f2(x(j)) - c1*1; end b = zeros(4,1); for j = 1:4 b(j) = f1(c1*x(j))+f2(c2*x(j))-1; end a b