summaryrefslogtreecommitdiff
path: root/964/CH4/EX4.7
diff options
context:
space:
mode:
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