Вы находитесь на странице: 1из 6

Answer 1

__________
a) (9.4e-05)+(3.6e+04) = 3.6000000094e+004
b) (9.4e-05)+(3.6e+04) = 3.6000e+004 (Upto 5 significant digits)
c) Absolute Error = 9.4000e-005
d) Relative Error = 2.6111e-009
Answer 2
__________
The value of exp(pi*sqrt(163)) is 2.62537412640768260e+017
Its relative error with the 18 digit integer 262537412640768744 is
1.8282901235e-015 which is quite insignificant.
Hence the two numbers are very close.
Answer 3
__________
Three Digit Rounding
--------------------a) 133+0.921 = 1.33921e+002
Rounded Number=134
Absolute Error = 7.90e-002
Relative Error = 5.89900e-004
b) 122-0.499= 1.21501e+002
Rounded Number=122
Absolute Error = 4.99e-001
Relative Error = 4.10696e-003
c) (121-0.327)-119= 1.6730e+000
Rounded Number=2.00
Absolute Error = 3.27e-001
Relative Error = 1.95457e-001
d) (121-119)-0.327= 1.6730e+000
Rounded Number=1.67
Absolute Error = 3e-003

Relative Error = 1.79319e-003


e) ((13/14)-(3/4))/((2*exp(1))-5.4)= 4.88385e+000
Rounded Number=4.48
Absolute Error = 4.0385e-001
Relative Error = 8.26910e-002
f) (pi-(22/7))/(1/17)= -2.14963e-002
Rounded Number=0
Absolute Error = 2.14963e-002
Relative Error = 1
Four Digit Chopping
--------------------a) 133+0.921 = 1.33921e+002
Chopped Number=133.9
Absolute Error = 2.10e-002
Relative Error = 1.56809e-004
b) 122-0.499= 1.21501e+002
Chopped Number=121.5
Absolute Error = 1.00e-003
Relative Error = 8.23038e-006
c) (121-0.327)-119= 1.67300e+000
Chopped Number=1.600
Absolute Error = 7.30e-002
Relative Error = 4.36e-002
d) (121-119)-0.327= 1.6730e+000
Chopped Number=1.6730
Absolute Error = 0
Relative Error = 0
e) ((13/14)-(3/4))/((2*exp(1))-5.4)= 4.88385e+000
Chopped Number=4.958
Absolute Error = 7.4150e-002

Relative Error = 1.51826e-002


f) (pi-(22/7))/(1/17)= -2.14963e-002
Chopped Number=-0.0170
Absolute Error = 4.49632e-003
Relative Error = 2.09167e-001
Answer 4
__________
a) 4(atan(1/2)+atan(1/3))= pi
Approximation= 3.14558e+000
Absolute Error = 3.98348e-003
Relative Error = 1.26798e-003
b) 16(atan(1/5)-4atan(1/239)=pi
Approximation= 3.17509e+000
Absolute Error = 3.35010e-002
Relative Error = 1.06637e-002
Answer 5
__________
a) sin(2)=9.09297e-001
Approximation (series two terms) = 6.66667e-001
Absolute Error = 2.42631e-001
Relative Error = 2.66833e-001
b) I have used five partial sum approximations. They are:
1.
2.
3.
4.
5.

x-(x^3)/3!
x-(x^3)/3!+(x^5)/5!
x-(x^3)/3!+(x^5)/5!-(x^7)/7!
x-(x^3)/3!+(x^5)/5!-(x^7)/7!+(x^9)/9!
x-(x^3)/3!+(x^5)/5!-(x^7)/7!+(x^9)/9!-(x^11)/11!

Errors at pi/6
--------------sin(pi/6)=0.5
Approximation
Absolute
-------------- --------------4.9967418e-001

3.25821e-004

Relative
-------------6.51641e-004

(first appx)

5.0000213e-001

2.13259e-006

4.26518e-006

(second appx)

4.9999999e-001

8.13098e-009

1.62620e-008

(third appx)

5.0000000e-001

2.02799e-011

4.05598e-011

(fourth appx)

5.0000000e-001

3.56865e-014

7.13730e-014

(fifth appx)

Errors at pi/4
--------------sin(pi/4)=0.70711
Approximation
Absolute
-------------- ---------------

Relative
--------------

7.0465265e-001

2.45413e-003

3.47066e-003

(first appx)

7.0714305e-001

3.62646e-005

5.12859e-005

(second appx)

7.0710647e-001

3.11611e-007

4.40685e-007

(third appx)

7.0710678e-001

1.75032e-009

2.92893e-001

(fourth appx)

7.0710678e-001

6.92801e-012

9.79768e-012

(fifth appx)

Errors at pi/2
--------------sin(pi/2)=1.00000
Approximation
Absolute
-------------- ---------------

Relative
--------------

9.2483223e-001

7.51678e-002

7.51678e-002

(first appx)

1.0045249e+000

4.52486e-003

4.52486e-003

(second appx)

9.9984310e-001

1.56899e-004

1.56899e-004

(third appx)

1.0000035e+000

3.54258e-006

5.00004e-001

(fourth appx)

9.9999994e-001

5.62589e-008

5.62589e-008

(fifth appx)

Errors at pi*3
--------------sin(pi*3)=0.00000
Approximation
Absolute
-------------- ---------------1.3010347e+002

1.30103e+002

Relative
-------------not defined

(first appx)

4.8958639e+002

4.89586e+002

not defined

(second appx)

-8.2100513e+002

8.21005e+002

not defined

(third appx)

7.9587236e+002

7.95872e+002

not defined

(fourth appx)

-5.0977738e+002

5.09777e+002

not defined

(fifth appx)

This shows that expansion of sin(x) is valid for small x


Answer 6
__________
Actual Value of e = 2.7182818285
a) Summation from 0 to 5 --1/n! = 2.7166666667e+000
Absolute Error = 1.61516e-003
Relative Error = 5.94538e-004
b) Summation from 0 to 10 --1/n! = 2.7182818011e+000
Absolute Error = 2.73127e-008
Relative Error = 1.00478e-008
c) Summation from 0 to 33 1/n! = 2.7182818320e+000 ( C-program able to get upt
o 33!)
Absolute Error = 3.52761e-009
Relative Error = 1.29773e-009
Summation from 0 to 1000 1/n! = 2.71828182845904510e+000 ( Using Wolfram-Alp
ha )
Absolute Error = 0.00000000000000000
Relative Error = 0.00000000000000000
Answer 7
__________
Example 4
__________
Five Digit Chopping
Operation
x-u

Result
3.0000e-005

Actual Value
3.47143e-005

Absolute Error
4.71429e-006

Relative Error
1.35802e-001

(x-u)/w

2.7000e+000

3.12429e+000

4.24262e-001

1.35795e-001

(x-u)*v

3.4286e+000

2.96295e+000

4.65638e-001

1.35810e-001

u+v

9.8767e+004

9.87650e+004

1.61424e+000

1.63440e-005

Thus the values are correct as per example 4 of the textbook and relative error
is smallest for u+v.
Example 5
__________
p-q = 1.60000e-004
Four digit rounding
--------------------------Approximation=2.00e-004
Absolute Error=4.00e-005
Relative Error =2.50e-001
Four digit chopping
------------------------Approximation=1.00e-004
Absolute Error=6.00e-005
Relative Error =3.75e-001
Therefore,the chopping has more relative error and has brought in inaccuracy.

Вам также может понравиться