Lecture 6 Flashcards
Find decay f(n)=error (semilogy)
exponential function decay y=base^{⍺.n}
log(y) = ⍺.n.log(base) = ⍺n (if log same base)
⍺=Δy/Δx=(log(y2)-log(y1))/(x2-x1)
or ⍺= Δy/(log(base).Δx)
Find decay f(n)=error
power function decay n^{b}
e=an^b
log(e) = log(a)+b.log(n)
b=Δy/Δx…
Algebraic convergence vs. growth
error = O(1/n^⍺) vs. O(n^⍺), power functions, ⍺ algebraic index of convergence. Straight line in a loglog plot.
Exponential convergence vs. growth
error = O(e^-{⍺n}) vs. O(n^{⍺n}), exponential functions. Straight line in a semilogy plot. Much faster than algebraic.
Taylor degree 3 at x0=12. For h1=0.5 you get a truncation error e1=10^-4. What’s the error e2 for h2=0.25?
Error = O(h^4)
e1 = c.h1^4
e2 = c.h2^4
So e2 = 10^-4 (h2/h1)^4
Taylor app derivatives
Need to increase degree and derivate Taylor app
Taylor app integral f(x)
∑(0→∞) f^(i)(0)/i! ∫(s→t)x^i dx = ∑(0→∞) f^(i)(0)/i! (t^{i+1}-s^{i+1})/(i+1)
Number representation in a β-system
(an…a1 a0.b1 b2…)β = ∑(0→n) ak.β^k + ∑(1→∞) bk.β^-k
Python int to bin, bin to int
bin(15) = '0b1111' int(0b1111) = 15
Consider a (binary) floating point system of the form (1.b1b2b3b4b5b6) x 2^m, m \in {-128,127}. Which is the largest k s.t. all integers [-k,k] can be represented?
Max : 1.111111 x 2^6 = 1111111 = 2^7 = 128
Subnormal Numbers: IEEE single precision numbers store 23 bits in the fraction. The smallest possible exponent value in the format is −126.
If you want to store a number x<2^{−131}, what is the largest possible number of significant bits in the machine representation of your number?
0.000001… x 2^126 (LESS than 2^{-131}), so at most 23-5 = 18 significant bits.