Assignment-I
1) Calculate the following series (using single precision and double precision) and compare the result with the exact value (for x=0, 10, 20, 30). Analyze the results.
ex= [(-1)n-²
Calculate et
8
e-*
=Σ 5n = [(-1) for Sn=-Sn-1
n=0
n=0
n=0
n=0
N
S1 = Σ
n=1
n!
n!
n
n!
Use Truncation Value = 10-5 for SP and 10-12 for DP and inverse it
Consider finite series (N is finite):
1
Assignment-I
2) Consider the following series (using single precision and double precision):
$2=
n=N
X
S1 S2 (roundoff errors)
n
Using single precision and N=106, show S1 ‡ $2
Using double precision $₁ exactly equal to $2 for N=106
• But for N=108 double precision $1 differs from $2
1. Calculate exp(-x) by in inverse exp(x) by a python program
Calculate exp(-x) by expanding Taylor series by a python programming
2. Sum 1/n from 1 to n and n to 1 using single precision by a python program
Sum 1/n from 1 to n and n to 1 to n using double precision by a python program
Analysis and answer
Assignment-I
1 Calculate the following series (using single precision and double precision and compare the result with the exact value for x=0,10,20,30. Analyze the results
n-o
n!
x 1-us-=usIOJ n!
n
n=0
=x x Calculate iMs n! and inverse it
Use Truncation Value=10-5 for SP and 10-12 for DP
Assignment-I
2 Consider the following series (using single precision and double precision):
Consider finite series (N is finite):
1
s1= n=in
n=Nn
Si s2roundoff errors
Using single precision and N=10, show si s2
Using double precision Si exactly equal to S2 for N=106 But for N=108 double precision si differs from s2