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 --- 964/CH6/EX6.8/6_8.sce | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 964/CH6/EX6.8/6_8.sce (limited to '964/CH6/EX6.8') diff --git a/964/CH6/EX6.8/6_8.sce b/964/CH6/EX6.8/6_8.sce new file mode 100755 index 000000000..0f44bec04 --- /dev/null +++ b/964/CH6/EX6.8/6_8.sce @@ -0,0 +1,20 @@ +//clc() +del = 0.01; +z = 0.56714329 +x1 = 1; +//f(x) = exp(-x) - x +disp(x1,"x1 = ") +for i = 1:4 + if i == 1 then + x(i) = 1 + else + w = x(i-1); + m = exp(-x(i-1)) - x(i-1); + x(i-1) = x(i-1)*(1+del); + n = exp(-x(i-1)) - x(i-1); + x(i) = w - (x(i-1)- w) * m/(n-m); + em = (z - x(i))*100/z; + disp(x(i),"x = ") + disp("%",em,"error = ") + end +end -- cgit