Docsity

Assignment 5 for Compiler and Optimization | CMSC 878, Assignments of Computer Science

Toggle sidebar
bg1
CMSC878R/ AMSC698R Assignment 5
1 Problem (Homework 5)
Evaluate accuracy of the p-truncated S|R-reexpansion of function with translation vector t(in this 1-D case
this is a scalar)
Φ(y, xi)= 1
y−xi
,
where xiis an arbitrary point, xi∈£−1
2l, 1
2l¤,y∈£3
2l, 5
2l¤,t=2l.
2 Homework 5
1. Using examples from the lectures, provide a formula for S-expansion of Φ(y,xi)near x∗=0,that can be
used for approximation of this function for |y|>3
2l. Find theoretically the dependence of the maximum
absolute error on truncation number pand on the length of the interval l. Also provide a formula for
the inverse function, i.e. the dependence p(l,),which enables determintion of the truncation number
for a given land . Compare your theoretical dependence with some test computations (e.g. you can
take xi=1
2l;y=3
2l, and vary pand l) and provide a graph of these comparisons.
2. Implement a routine that provides p-truncated S|R-translation of S-expansion coefficients to R-expansion
coefficients (so that it can be used in your future FMM program). As input to your routine you should
take a vector of S-expansion coefficients of length pand translation vector t, and as output it should
provide a vector of R-expansion coefficients of length p.
3. Test your program using as input coefficients the p-truncated S-expansion of Φ(y, xi),and vector t=2l.
Multiply the output vector of R-expansion coefficients with R-basis functions centered at x∗=2lto
get an approximate value of Φ(y,xi)for several points y∈£3
2l, 5
2l¤.Compare this result with exact
(straightforward) computation of Φ(y,xi).
4. Obtain a theoretical error bounds of p-truncated S|R-translation. Compare this result with numerical
experiments for various pand l. Provide a graph that illustrates and compares theoretical and numerical
dependences. Make some conclusions.
3 Hints (Homework 5)
•Use the property of geometric progression for error evaluations
1
1−α=1−αp+αp
1−α=1−αp
1−α+αp
1−α=1+α+... +αp−1+αp
1−α,(α6=1).(1)
(if you wish, you still can use the Taylor series and evaluate the residual term).
•Fornumber4,Consider¯
¯Φ(y, xi)−Φ(p)(y,xi)¯
¯,whereΦ(p)(y, xi)is obtained by application of the
S|R-truncated matrix to the p-truncated vector of S-expansion coefficients and multplied with the
R-basis functions. The series will contain a finite number of terms. At the same time Φ(y, xi)will be
represented by the same series with an infinite number of terms. To estimate the error you need to
evaluate the ‘tails’. You may use the fact that the series converges absolutely and uniformly, and use
the inequality ¯
¯
¯
¯
¯X
n
an
¯
¯
¯
¯
¯6X
n
|an|,(2)
and the following generalization for the binomials:
1
(1 −α)m+1 =
∞
X
n=0
(m+n)!
m!n!αn,|α|<1,m=0,1,... (3)
c
°N.A. Gumerov & R. Duraiswami, 2002-2003. 1

Partial preview of the text

Download Assignment 5 for Compiler and Optimization | CMSC 878 and more Assignments Computer Science in PDF only on Docsity!

CMSC878R/ AMSC698R Assignment 5

1 Problem (Homework 5)

Evaluate accuracy of the p-truncated S|R-reexpansion of function with translation vector t (in this 1-D case this is a scalar)

Φ(y, xi) =

y − xi

where xi is an arbitrary point, xi ∈

− 12 l, 12 l

, y ∈

2 l,^

5 2 l

, t = 2l.

2 Homework 5

  1. Using examples from the lectures, provide a formula for S-expansion of Φ(y, xi) near x∗ = 0, that can be used for approximation of this function for |y| > 32 l. Find theoretically the dependence of the maximum absolute error  on truncation number p and on the length of the interval l. Also provide a formula for the inverse function, i.e. the dependence p(l, ), which enables determintion of the truncation number for a given l and . Compare your theoretical dependence with some test computations (e.g. you can take xi = 12 l; y = 32 l, and vary p and l) and provide a graph of these comparisons.
  2. Implement a routine that provides p-truncated S|R-translation of S-expansion coefficients to R-expansion coefficients (so that it can be used in your future FMM program). As input to your routine you should take a vector of S-expansion coefficients of length p and translation vector t, and as output it should provide a vector of R-expansion coefficients of length p.
  3. Test your program using as input coefficients the p-truncated S-expansion of Φ(y, xi), and vector t = 2l. Multiply the output vector of R-expansion coefficients with R-basis functions centered at x∗ = 2l to get an approximate value of Φ(y, xi) for several points y ∈

2 l,^

5 2 l

. Compare this result with exact (straightforward) computation of Φ(y, xi).

  1. Obtain a theoretical error bounds of p-truncated S|R-translation. Compare this result with numerical experiments for various p and l. Provide a graph that illustrates and compares theoretical and numerical dependences. Make some conclusions.

3 Hints (Homework 5)

  • Use the property of geometric progression for error evaluations 1 1 − α

1 − αp^ + αp 1 − α

1 − αp 1 − α

αp 1 − α

= 1 + α + ... + αp−^1 +

αp 1 − α

, (α 6 = 1). (1)

(if you wish, you still can use the Taylor series and evaluate the residual term).

  • For number 4, Consider

¯Φ (y, xi) − Φ(p)^ (y, xi)

¯, where Φ(p)^ (y, xi) is obtained by application of the S|R-truncated matrix to the p-truncated vector of S-expansion coefficients and multplied with the R-basis functions. The series will contain a finite number of terms. At the same time Φ (y, xi) will be represented by the same series with an infinite number of terms. To estimate the error you need to evaluate the ‘tails’. You may use the fact that the series converges absolutely and uniformly, and use the inequality (^) ¯ ¯ ¯ ¯¯

X

n

an

X

n

|an| , (2)

and the following generalization for the binomials: 1 (1 − α)m+^

X^ ∞

n=

(m + n)! m!n! αn, |α| < 1 , m = 0, 1 , ... (3)

°cN.A. Gumerov & R. Duraiswami, 2002-2003. 1