

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


1.1.1 Floating Point Numbers
%round number x to normalized p-digit form function x=fl(x,p) if x~= deci=ceil(log10(abs(x))); x=round(x10^(p-deci))10^(deci-p); end
1.1.2 Roundoff Errors
absolute error : |x − x∗|
relative error :
∣∣ ∣∣^ x^ −^ x
∗ x
∣∣ ∣∣ , where x 6 = 0
x − f l(x) x
∣∣ ∣∣ ∣ ≤^0.^5 ×^10
−p+
(a) 0. 123 x^2 + 4. 51 x + 0.103 = 0 with 3-digit rounding (b) 1 − cos x x^2 over − 5 × 10 −^8 ≤ x ≤ 5 × 10 −^8
Suppose that {xn}∞ n=0 converges to x.
(a) π = 4
[ 1 −
(−1)n 2 n + 1
]
(b) π = 4
( tan−^1
) , together with
tan−^1 x = x − x^3 3
x^5 5
x^7 7
(−1)nx^2 n+ 2 n + 1 +... , − 1 < x ≤ 1
|xn+1 − xn| < tol or (^) ∣∣ ∣∣^ xn+1^ −^ xn xn
∣∣ ∣∣ < tol;
for example, golden ratio again
xn = 2xn− 1 − xn− 2 , n ≥ 2 , x 0 = 1, x 1 =
noting that the exact solution is
xn = 1 − 2 n 3
xn =
xn− 1 − xn− 2 , n ≥ 2 , x 0 = 1, x 1 =
noting that the exact solution is
xn =
3 n