summaryrefslogtreecommitdiff
path: root/964/CH4/EX4.7
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /964/CH4/EX4.7
downloadScilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip
initial commit / add all books
Diffstat (limited to '964/CH4/EX4.7')
-rwxr-xr-x964/CH4/EX4.7/4_7.sce17
1 files changed, 17 insertions, 0 deletions
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