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/CH4/EX4.7/4_7.sce | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 964/CH4/EX4.7/4_7.sce (limited to '964/CH4/EX4.7') diff --git a/964/CH4/EX4.7/4_7.sce b/964/CH4/EX4.7/4_7.sce new file mode 100755 index 000000000..242607647 --- /dev/null +++ b/964/CH4/EX4.7/4_7.sce @@ -0,0 +1,17 @@ +clc; +clear; +function y=f(x) + y=tan(x) +endfunction +x1bar=(%pi/2)+0.1*(%pi/2); +x2bar=(%pi/2)+0.01*(%pi/2); +//computing condition number for x1bar +condnum1=x1bar*derivative(f,x1bar)/f(x1bar); +disp(condnum1,"is:",x1bar,"The condition number of function for x=") +if abs(condnum1)>1 then disp(x1bar,"Function is ill-conditioned for x=") +end +//computing condition number for x2bar +condnum2=x2bar*derivative(f,x2bar)/f(x2bar); +disp(condnum2,"is:",x2bar,"The condition number of function for x=") +if abs(condnum2)>1 then disp(x2bar,"Function is ill-conditioned for x=") +end \ No newline at end of file -- cgit