Tải bản đầy đủ (.pdf) (31 trang)

09 taylor models proof that arithmetic operation perforrmed with floatin point arithmetic provide guaranteed results n revol

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (136.51 KB, 31 trang )

Taylor models: proof that arithmetic
operations performed with floating-point
arithmetic provide guaranteed results
Nathalie Revol INRIA, projet Ar´enaire, LIP, ENS Lyon

Taylor models mini-workshop, Miami Beach, December 16-20, 2002
Outline
Taylor models: introduction
• Taylor models: definition
• Taylor models and floating-point arithmetic
Arithmetic operations in Taylor models using FP arithmetic
• Multiplication by a scalar
• Addition
• Multiplication
Proof that arithmetic operations are correct
• Multiplication by a scalar
• Addition
• Multiplication
Conclusion and “TODO” list
Taylor models mini-workshop, Miami Beach, December 16-20, 2002 - 1 N. Revol
Taylor models: definition
f : [−1, 1]
v
→ IR
(x
1
, ··· , x
v
) → f(x
1
, ··· , x


v
)
is represented by
T
o
(x
1
, ··· , x
v
) + I
L
where
T
o
is a polynomial of order o
I
L
is an interval enclosing the Lagrange remainder,
I
L
=
1
(o+1)!
f
(o+1)


× [−1, 1]
Taylor models mini-workshop, Miami Beach, December 16-20, 2002 - 2 N. Revol
Taylor models: principle on a graphic

−1 1
0
Taylor models mini-workshop, Miami Beach, December 16-20, 2002 - 3 N. Revol
Taylor models: principle on a graphic
−1 1
0
F([−1,1])
f
Taylor models mini-workshop, Miami Beach, December 16-20, 2002 - 4 N. Revol
Taylor models: principle on a graphic
−1 1
0
F([−1,1])
f
Taylor models mini-workshop, Miami Beach, December 16-20, 2002 - 5 N. Revol
Taylor models: principle on a graphic
−1 1
0
F([−1,1])
f
Taylor models mini-workshop, Miami Beach, December 16-20, 2002 - 6 N. Revol
Taylor models and floating-point arithmetic
f : [−1, 1]
v
→ IR
(x
1
, ··· , x
v
) → f(x

1
, ··· , x
v
)
is represented by
T
o
(x
1
, ··· , x
v
) + I
F P
T
o
is a polynomial with floating-point co efficients of order o
I
F P
is an interval enclosing the Lagrange remainder
and an enclosure of the rounding errors
Taylor models mini-workshop, Miami Beach, December 16-20, 2002 - 7 N. Revol
Taylor models, FP arithmetic and sparse
representation
f : [−1, 1]
v
→ IR
(x
1
, ··· , x
v

) → f(x
1
, ··· , x
v
)
is represented by
T
o
(x
1
, ··· , x
v
) + I
T
o
is a polynomial with not too small floating-point coefficients
I
F P
is an interval enclosing the Lagrange remainder,
an enclosure of the rounding errors and
an enclosure of the terms corresponding to small coefficients
Taylor models mini-workshop, Miami Beach, December 16-20, 2002 - 8 N. Revol
Question: are the results guarant eed enclosures?
Recollection
[A. Benedetti ] (message from March 2002)
In the works of Berz the coefficients of the polynomial
part are always represented by floating point numbers. Shouldn’t
these be intervals? Since the coefficients are manipulated
every time the Taylor models are combined in arithmetic
operations or used as arguments in elementary functions,

how can I get verified result if intervals are not used
for the coefficients?
Question: what is the approximation order?
Taylor models mini-workshop, Miami Beach, December 16-20, 2002 - 9 N. Revol
Definition of the approximation or der
Usual analysis: x be ing a point, T is of order o iff
∀x ∈ X, |T (x) − f(x)| = O(x
o
)
Taylor models (using exact arithmetic) are of order o.
What happens with floating-point coefficients?
Notion of approximate order?
Interval analysis: X being an interval, F is of order o iff
w(F (X)) = O(w(X)
o
)
Order > 2: NP-hard.
Cocnlusion: same vocabulary but not same meaning.
Taylor models mini-workshop, Miami Beach, December 16-20, 2002 - 10 N. Revol
Outline
Taylor models: introduction
• Taylor model: definition
• Taylor models and floating-point arithmetic
Arithmetic operations in Taylor models using FP arithmetic
• Multiplication by a scalar
• Addition
• Multiplication
Proof that arithmetic operations are correct
• Multiplication by a scalar
• Addition

• Multiplication
Conclusion and “TODO” list
Taylor models mini-workshop, Miami Beach, December 16-20, 2002 - 11 N. Revol
Taylor models: notations
coefficients of the polynomial: a
i
, 1 ≤ i ≤ p (floating-point numbers)
I interval containing the Lagrange remainder, the bound on rounding
errors and the swept terms.
ε
m
: machine precis ion, i.e. for every operation the relative rounding
error is ≤ ε
m
/2
ε
u
: machine underflow threshold
ε
c
: logical underflow threshold: every number < ε
c
is replaced by 0
or swept (hyp: ε
2
c
> ε
u
)
t : tallying variable (for rounding errors)

s : sweeping variable (to get rid of small coefficients).
Taylor models mini-workshop, Miami Beach, December 16-20, 2002 - 12 N. Revol
Taylor models: operations using an ideal arithmetic
Multiplication by a scalar
T

= [b
k
, J] = c ×T with T = [a
i
, I] :
for k = 1 to p do
b
k
= c × a
k
J = c × I
Addition
T = [b
k
, J] = T
1
+ T
2
with T
1
= [a
(1)
i
, I

(1)
] and T
2
= [a
(2)
i
, I
(2)
] :
for k = 1 to p do
b
k
= a
(1)
k
+ a
(2)
k
J = I
(1)
+ I
(2)
Taylor models mini-workshop, Miami Beach, December 16-20, 2002 - 13 N. Revol
Taylor models: operations using an ideal arithmetic
Multiplication
T = [b
k
, J] = T
1
× T

2
with T
1
= [a
(1)
i
, I
(1)
] and T
2
= [a
(2)
i
, I
(2)
] :
J = I
(1)
× I
(2)
for k = 1 to p do
for j = 1 to p do
if l := order(j)+ order(k) ≤ o then
b
l
= b
l
+ a
(1)
k

× a
(2)
j
else
J = J + [−|a
(1)
k
× a
(2)
j
|, |a
(1)
k
× a
(2)
j
|]
J = J + [−

i
|a
(1)
i
|,

i
|a
(1)
i
|] × I

(2)
J = J + I
(1)
× [−

i
|a
(2)
i
|,

i
|a
(2)
i
|]
Taylor models mini-workshop, Miami Beach, December 16-20, 2002 - 14 N. Revol
Taylor models: operations
using floating-point arithmetic
Notations: ideal operations: usual symbols,
floating-point or interval operations: circled symbols.
Multiplication by a scalar
T

= [b
k
, J] = c ×T with T = [a
i
, I] :
error upper bounded by:

for k = 1 to p do
b
k
= c ⊗ a
k
ε
m
/2 × |c × a
k
|
J = c ⊗ I interval operation
Taylor models mini-workshop, Miami Beach, December 16-20, 2002 - 15 N. Revol
Taylor models: operations
using floating-point arithmetic
Addition
T = [b
k
, J] = T
1
+ T
2
with T
1
= [a
(1)
i
, I
(1)
] and T
2

= [a
(2)
i
, I
(2)
] :
error upper bounded by:
for k = 1 to p do
b
k
= a
(1)
k
⊕ a
(2)
k
ε
m
/2 × (|a
(1)
k
| + |a
(2)
k
|)
J = I
(1)
⊕ I
(2)
interval operation

Taylor models mini-workshop, Miami Beach, December 16-20, 2002 - 16 N. Revol
Taylor models: operations using FP arithmetic
Multiplication
T = [b
k
, J] = T
1
× T
2
with T
1
= [a
(1)
i
, I
(1)
] and T
2
= [a
(2)
i
, I
(2)
] :
J = I
(1)
⊗ I
(2)
error upper bounded by:
for k = 1 to p do

for j = 1 to p do
p = a
(1)
k
⊗ a
(2)
j
ε
m
/2 × |a
(1)
k
× a
(2)
k
|
if l := order(j)+ order(k) ≤ o then
b
l
= b
l
⊕ p ε
m
/2 × (|b
l
| + |p|)
else
J = J ⊕[−|p|, |p|] interval operation
J = J + [−


i
|a
(1)
i
|,

i
|a
(1)
i
|] × I
(2)
interval operations
J = J + I
(1)
× [−

i
|a
(2)
i
|,

i
|a
(2)
i
|] except on the sums
Taylor models mini-workshop, Miami Beach, December 16-20, 2002 - 17 N. Revol
Outline

Taylor models: introduction
• Taylor model: definition
• Taylor models and floating-point arithmetic
Arithmetic operations in Taylor models using FP arithmetic
• Multiplication by a scalar
• Addition
• Multiplication
Proof that arithmetic operations are correct
• Multiplication by a scalar
• Addition
• Multiplication
Conclusion and “TODO” list
Taylor models mini-workshop, Miami Beach, December 16-20, 2002 - 18 N. Revol
Taylor models: estimating floating-point errors
using floating-point arithmetic
Problem (paradox): rounding errors are due to floating-point
arithmetic: how to estimate the m using floating-point arithmetic?
Starting point:
(assumption) nb op × ε
m
≤ 1/2
and
|(a ⊕ b) − (a + b)| ≤ ε
m
⊗ (|a| ⊕ |b|)
and even
|(a ⊕ b) − (a + b)| ≤ ε
m
⊗ max(|a|, |b|)
|(a ⊗ b) − (a × b)| ≤ ε

m
⊗ |a ⊗ b|
Taylor models mini-workshop, Miami Beach, December 16-20, 2002 - 19 N. Revol
Taylor models: estimating floating-point errors
using floating-point arithmetic
Multiplication by a scalar
T

= [b
k
, J] = c ×T with T = [a
i
, I] :
t = 0
s = 0
for k = 1 to p do
b
k
= c ⊗ a
k
t = t ⊕ |b
k
|
if |b
k
| < ε
c
then
s = s ⊕ |b
k

|
b
k
= 0
J = c ⊗ I ⊕ 2 ⊗ ε
m
⊗ [−t, t] ⊕ 2 ⊗ [−s, s]
Taylor models mini-workshop, Miami Beach, December 16-20, 2002 - 20 N. Revol
Taylor models: estimating floating-point errors
using floating-point arithmetic
Goal: either prove that is provides guaranteed results or propose an
algorithm that provides guaranteed results.
1. prove that the t variable really takes into account rounding errors
(i.e. the e rrors for c ⊗ a
k
and the errors for the accumulation into
t);
2. prove that the swept terms (put into s) and the errors for the
computation of s are correctly taken into account;
3. the last operation is an interval one, thus rounding e rrors are taken
into account properly.
Notations: ideal operations: usual symbols,
floating-point or interval operations: circled symbols.
Taylor models mini-workshop, Miami Beach, December 16-20, 2002 - 21 N. Revol
Taylor models: multiplication by a scala
proof for the computation of t
• error on b
k
= c ⊗ a
k

≤ ε
m
⊗ |b
k
| ≤ ε
m

1 +
ε
m
2

|b
k
|


k
error on b
k


k
ε
m
⊗ |b
k
| ≤ ε
m


1 +
ε
m
2


k
|b
k
|.
• computed value = 2 ⊗ ε
m


k
|b
k
| ≥ 2ε
m

1 −
ε
m
2


k
|b
k
|.

Does this hold: ε
m

1 +
ε
m
2


k
|b
k
| ≤ 2ε
m

1 −
ε
m
2


k
|b
k
|?
Taylor models mini-workshop, Miami Beach, December 16-20, 2002 - 22 N. Revol
• Relation between

k
|b

k
| and

k
|b
k
| ?
Higham (4.4): from now on, n = nb op
|

k
|b
k
| −

k
|b
k
|| ≤ n
ε
m
2

k
|b
k
|


k

|b
k
| ≤
1
1−n
ε
m
2

k
|b
k
|
We have ε
m

1 +
ε
m
2


k
|b
k
| ≤
ε
m

1 +

ε
m
2

1 − n
ε
m
2

k
|b
k
|,
dos this hold?
ε
m

1 +
ε
m
2

1 − n
ε
m
2

k
|b
k

| ≤ 2ε
m

1 −
ε
m
2


k
|b
k
|?
i.e.
1 +
ε
m
2

1 −
ε
m
2

.

1 − n
ε
m
2


≤ 2?
Yes thanks to ε
m
< 1/5 and nε < 1/2.
Taylor models mini-workshop, Miami Beach, December 16-20, 2002 - 23 N. Revol
proof for the computation of s
• Let K denote {k/|b
k
| < ε
c
}, let us prove that
2 ⊗ s = 2.

k∈K
|b
k
| ≥

k∈K
|b
k
| + error on this sum.
• error on this sum ≤

1 − K
ε
m
2


−1
.K
ε
m
2

k∈K
|b
k
|
• The following holds

k∈K
|b
k
|+ error on this sum ≤

1 − K
ε
m
2

−1
.

1 + K
ε
m
2



k∈K
|b
k
|
• as Kε
m
< 1/2,

1 − K
ε
m
2

−1

4
3
and

1 + K
ε
m
2


5
4
this gives the sought result.
Taylor models mini-workshop, Miami Beach, December 16-20, 2002 - 24 N. Revol

×