summaryrefslogtreecommitdiff
path: root/75/CH4/EX4.9/ex_8.sce
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /75/CH4/EX4.9/ex_8.sce
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 '75/CH4/EX4.9/ex_8.sce')
-rwxr-xr-x75/CH4/EX4.9/ex_8.sce20
1 files changed, 20 insertions, 0 deletions
diff --git a/75/CH4/EX4.9/ex_8.sce b/75/CH4/EX4.9/ex_8.sce
new file mode 100755
index 000000000..7c502a299
--- /dev/null
+++ b/75/CH4/EX4.9/ex_8.sce
@@ -0,0 +1,20 @@
+ // PG (223)
+
+deff('[y]=f(x)','y=exp(x)')
+
+x=[-1.0 -0.6919 0.0310 0.7229 1.0]; // defining x
+
+r3 = 0.996294 + 0.997955*x + 0.536722*x^2 + 0.176139*x^3;
+norm(exp(x)-r3,'inf'); // cubic least squares approximation
+deff('[y]=g(x)','y=0.994571+0.997308*x+0.542991*x^2+0.177347*x^3')
+// c3=g(x);
+x1=x(1,1);
+(exp(x1)-g(x1))
+x2=x(1,2);
+(exp(x2)-g(x2))
+x3=x(1,3);
+(exp(x3)-g(x3))
+x4=x(1,4);
+(exp(x4)-g(x4))
+x5=x(1,5);
+(exp(x5)-g(x5))