From b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b Mon Sep 17 00:00:00 2001 From: priyanka Date: Wed, 24 Jun 2015 15:03:17 +0530 Subject: initial commit / add all books --- 191/CH5/EX5.2/Example5_2.sce | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 191/CH5/EX5.2/Example5_2.sce (limited to '191/CH5/EX5.2/Example5_2.sce') diff --git a/191/CH5/EX5.2/Example5_2.sce b/191/CH5/EX5.2/Example5_2.sce new file mode 100755 index 000000000..8ddb401c6 --- /dev/null +++ b/191/CH5/EX5.2/Example5_2.sce @@ -0,0 +1,26 @@ +//Theoritical bound on error +//it needs Symbolic Toolbox +//cd ~\Desktop\maxima_symbolic; +//exec 'symbolic.sce' +clc; +clear; +close(); +syms x; +fx = log(x); +n = 2; +x0 = 2; +x1 = 2.5; +x2 = 3; +diff1_fx = diff(fx,x); +diff2_fx = diff(diff1_fx,x); +diff3_fx = diff(diff2_fx,x); +//so fx satisfies the continuity conditions on [2,3] +x= poly(0,'x'); +eta = linspace(2,3,100); +//fx-p2x is equal to +func = (x-2)*(x-2.5)*(x-3)*2/(factorial(3)*eta^3); +min_func = (x-2)*(x-2.5)*(x-3)*2/(factorial(3)*min(eta)^3); +disp(min_func , 'func will be less than or equal to'); +x = 2.7; +max_error = abs(horner(min_func,x)); +disp(max_error , 'Error does not exceed :'); \ No newline at end of file -- cgit