4ccurate 4lgorithms in Floating Point 4rithmetic

Size: px
Start display at page:

Download "4ccurate 4lgorithms in Floating Point 4rithmetic"

Transcription

1 4ccurate 4lgorithms in Floating Point 4rithmetic Philippe LANGLOIS 1 1 DALI Research Team, University of Perpignan, France SCAN 2006 at Duisburg, Germany, September 2006 Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 1 / 42

2 Compensated algorithms in floating point arithmetic 1 Compensated algorithms: why and how? 2 Basic bricks towards compensated algorithms 3 Compensated Horner algorithm 4 Performance: arithmetic and processor issues 5 Conclusion Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 2 / 42

3 Algorithm accuracy vs. condition number For a given working precision u, Backward stable algorithms: The solution accuracy is no worse than condition number computing precision ( O(problem dimension)) Example: arithmetic operators, classic algorithms for summation, dot product, Horner s method, backward substitution, GEPP,... How to manage ill-conditionned cases, i.e., when condition number > 1/u? Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 3 / 42

4 Algorithm accuracy vs. condition number For a given working precision u, Backward stable algorithms: The solution accuracy is no worse than condition number computing precision ( O(problem dimension)) Example: arithmetic operators, classic algorithms for summation, dot product, Horner s method, backward substitution, GEPP,... How to manage ill-conditionned cases, i.e., when condition number > 1/u? Highly accurate or even faithful algorithms: The solution accuracy is independant of the condition number (for a range of it) A faithful rounded result is sometimes available Example: Priest s algorithm, distillation algorithms, Rump-Ogita-Oishi for summation and dot product, iterative refinement with extra precision, (polynomial evaluation of a canonical form needs the roots!,... ). Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 3 / 42

5 Compensated algorithms Compensated algorithm corrects the generated rounding error the solution accuracy is no worse than computing precision + condition number (computing precision) K ; the computation is performed only with the working precision u; the performances are no worse than expansion libraries (double-double, quad-double) and even more general ones (arprec, MPFR,... ). It also returns a validated dynamic error bound. (bonus) Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 4 / 42

6 Compensated algorithms Compensated algorithm corrects the generated rounding error the solution accuracy is no worse than computing precision + condition number (computing precision) K ; the computation is performed only with the working precision u; the performances are no worse than expansion libraries (double-double, quad-double) and even more general ones (arprec, MPFR,... ). It also returns a validated dynamic error bound. (bonus) Accuracy as if computed in twice the working precision alternative to double-double in e.g., XBLAS Compensated summation: Neumaier (74), Sum2 in Ogita-Rump-Oishi (05) Compensated Horner algorithm and compensated backward substitution Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 4 / 42

7 Compensated algorithms Compensated algorithm corrects the generated rounding error the solution accuracy is no worse than computing precision + condition number (computing precision) K ; the computation is performed only with the working precision u; the performances are no worse than expansion libraries (double-double, quad-double) and even more general ones (arprec, MPFR,... ). It also returns a validated dynamic error bound. (bonus) Accuracy as if computed in twice the working precision alternative to double-double in e.g., XBLAS Compensated summation: Neumaier (74), Sum2 in Ogita-Rump-Oishi (05) Compensated Horner algorithm and compensated backward substitution Accuracy as if computed in K times the working precision Compensated summation: SumK Ogita-Rump-Oishi (05) Compensated Horner algorithm Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 4 / 42

8 Algorithm accuracy vs. condition number 1 1/u Backward stable algorithms 1/u 2 1/u 3 1/u 4 relative forward error Compensated algorithms u Highly accurate Faithful algorithms 1/u 1/u 2 1/u 4 condition number Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 5 / 42

9 Introducing example: rounding errors when solving Tx = b Classic substitution algorithm computes x i = ( b i i 1 j=1 t i,jx j ) /t i,i, i = 1 : n Algorithm (... and its generated rounding errors inner loop) s i,0 = b i for j = 1 : i 1 loop p i,j = t i,j x j { generates π i,j } s i,j = s i,j 1 p i,j { generates σ i,j } end loop x i = s i,i 1 t i,i { generates δ i } The global forward error in computed x is ( x i ) i=1:n, x i = x i x i = 1 i 1 (σ i,j π i,j t i,j x j ) + δ i t i,i j=1 Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 6 / 42

10 Algorithm (Inlining the computation of the correcting term x) for i = 1 : n loop s i,0 = b i u i,0 = 0 for j = 1 : i 1 loop (p i,j, π i,j ) = TwoProd(t i,j, x j ) (s i,j, σ i,j ) = TwoSum(s i,j 1, p i,j ) u i,j = u i,j 1 (t i,j x j π i,j σ i,j ) end loop ( x i, δ i ) = ApproxTwoDiv(s i,i 1, t i,i ) x i = u i,i 1 t i,i δ i end loop Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 7 / 42

11 Algorithm (Inlining the computation of the correcting term x) for i = 1 : n loop s i,0 = b i u i,0 = 0 for j = 1 : i 1 loop (p i,j, π i,j ) = TwoProd(t i,j, x j ) (s i,j, σ i,j ) = TwoSum(s i,j 1, p i,j ) u i,j = u i,j 1 (t i,j x j π i,j σ i,j ) end loop ( x i, δ i ) = ApproxTwoDiv(s i,i 1, t i,i ) x i = u i,i 1 t i,i δ i end loop Algorithm (Compensating x adding the correction x) for i = 1 : n loop x i = x i x i end loop Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 7 / 42

12 Accuracy as in doubled precision for Tx = b dtrsv: IEEE-754 double precision substitution algorithm, dtrsv cor: compensated substitution algorithm, dtrsv x: XBLAS substitution with inner computation in double-double arithmetic 1 1e-2 dtrsv dtrsv_cor dtrsv_x 1e-4 relative forward error 1e-6 1e-8 1e-10 u n cond (2) u + u 2 n cond (3) 1e-12 1e-14 1e-16 u 1/(n u) 1/(n u 2 ) e+10 1e+15 1e+20 1e+25 1e+30 1e+35 1e+4 condition number Compensated substitution accuracy as if computed in doubled precision. Actual accuracy of compensated substitution is bounded as x x / x u + n cond(t, x) u 2. Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 8 / 42

13 Measured running times are interesting The general behavior: 1 Overhead to double the precision: measured running times are significantly better than expected from the theoretical flops count. 2 Compensated versus double-double: compensated algorithm runs about two times faster than its double-double counterpart. An example Env. 1: Intel Celeron: 2.4GHz, 256kB L2 cache - GCC Env. 2: Pentium 4: 3.0GHz, 1024kB L2 cache - GCC measured times theoretical ratio env. min mean max # flops compensated / double double-double / double double-double/compensated Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 9 / 42

14 Our first step towards compensated algorithms ( ) CENA: a software for automatic linear correction of rounding errors Motivation: automatic improvement and verification of the accuracy of a result computed by a program considered as a black box. Principle: compute a linear approximation of the global absolute error w.r.t. the generated elementary rounding error and use it as a correcting term. CENA = algorithmic differentiation + computing elementary rounding error + running error analysis + overloaded facilities (e.g., Fortran 90). Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 10 / 42

15 Our first step towards compensated algorithms ( ) CENA: a software for automatic linear correction of rounding errors Motivation: automatic improvement and verification of the accuracy of a result computed by a program considered as a black box. Principle: compute a linear approximation of the global absolute error w.r.t. the generated elementary rounding error and use it as a correcting term. CENA = algorithmic differentiation + computing elementary rounding error + running error analysis + overloaded facilities (e.g., Fortran 90). Should be considered as a development tool: easy to use, help to identify where to use more precision. Step 2: inlining the correction! Much more details in BIT 00, JCAM 01, TCS 03. Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 10 / 42

16 1 Compensated algorithms: why and how? 2 Basic bricks towards compensated algorithms Classic error free transformations 3 Compensated Horner algorithm 4 Performance: arithmetic and processor issues 5 Conclusion Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 11 / 42

17 Classic error free transformations Error free transformations are properties and algorithms to compute the generated elementary rounding errors at the CWP. Related works a, b entries in F, a b = fl (a b) + ε, with ε output in F EFT are so named by Ogita-Rump-Oishi (SISC, 05) sum-and-roundoff pair, product-and-roundoff pair in Priest (PhD, 92), no special name before. Recent and interesting discussion in Nievergelt (TOMS,04) Algorithms to compute the error term are extremely dependent to properties of the floating point arithmetic e.g., basis of representation, rounding mode... Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 12 / 42

18 Classic error free transformations Be careful: some of the following relations only apply for IEEE-754 arithmetic with rounding to the nearest. Summation: Møller (65), Kahan (65), Knuth (74), Priest(91). (s, σ) = TwoSum (a, b) is such that a + b = s + σ and s = a b. Product: Veltkampt and Dekker (72),... (p, π) = TwoProd (a, b) is such that a b = p + π and p = a b. Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 13 / 42

19 Classic error free transformations Be careful: some of the following relations only apply for IEEE-754 arithmetic with rounding to the nearest. Summation: Møller (65), Kahan (65), Knuth (74), Priest(91). (s, σ) = TwoSum (a, b) is such that a + b = s + σ and s = a b. Product: Veltkampt and Dekker (72),... (p, π) = TwoProd (a, b) is such that a b = p + π and p = a b. FMA: Boldo+Muller (05) (p, δ 1, δ 2 ) = ErrFMA(a, b, c) is such that p = FMA(a, b, c) and a b + c = p + δ 1 + δ 2. Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 13 / 42

20 Classic error free transformations Be careful: some of the following relations only apply for IEEE-754 arithmetic with rounding to the nearest. Summation: Møller (65), Kahan (65), Knuth (74), Priest(91). (s, σ) = TwoSum (a, b) is such that a + b = s + σ and s = a b. Product: Veltkampt and Dekker (72),... (p, π) = TwoProd (a, b) is such that a b = p + π and p = a b. FMA: Boldo+Muller (05) (p, δ 1, δ 2 ) = ErrFMA(a, b, c) is such that p = FMA(a, b, c) and a b + c = p + δ 1 + δ 2. Division and square root: Pichat (77), Markstein (90) If d = a b, then r = a d b is a floating point value. EFT exist for the remainder and the square and are not useful hereafter. Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 13 / 42

21 Not error free transformations Approximate division: Langlois+Nativel (98) (d, δ) = ApproxTwoDiv (a, b) is such that a/b = d + δ and d = a b, δ δ u δ. Approximate square root: Langlois+Nativel (98) Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 14 / 42

22 Algorithms to compute EFT: two examples Algorithm (fast-two-sum, Dekker (71)) function s, σ = FastTwoSum (a, b) % a b s := a b; b app := s a; σ := b b app cost: 3 flops and 1 test Algorithm (algorithm without pre-ordering or two-sum, Knuth (74)) function s, σ = TwoSum (a, b) s := a b; b app := s a; a app := s b app ; δ b := b b app ; δ a := a a app ; σ := δ a δ b ; cost: 6 flops Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 15 / 42

23 Error Free Transformations: summary EFT for proving theorems on error bounds Standard model: a b = fl (a b) (1 + η) with η u; EFT: a b = fl (a b) + ε Mathematical equalities between floating point entries Algorithms to compute EFT yield generated rounding errors, are performed at the working precision, without change of rounding mode, better benefit of hardware units: pipeline Cost in #flops TwoSum FastTwoSum TwoProd TwoProdFMA ThreeFMA 6 3 (+1 test) Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 16 / 42

24 1 Compensated algorithms: why and how? 2 Basic bricks towards compensated algorithms 3 Compensated Horner algorithm Compensated Horner algorithm Validated error bounds Faithful rounding with compensated Horner algorithm 4 Performance: arithmetic and processor issues 5 Conclusion Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 17 / 42

25 Accuracy of the Horner algorithm We consider the polynomial n p(x) = a i x i, i=0 with a i F, x F Algorithm (Horner) function r 0 = Horner (p, x) r n = a n for i = n 1 : 1 : 0 r i = r i+1 x a i end P cond(p, x) = ai x i p(x) 1 Relative accuracy of the evaluation with the Horner scheme: Horner (p, x) p(x) p(x) γ 2n }{{} 2nu cond(p, x) u is the computing precision: IEEE-754 double, 53-bits mantissa, rounding to the nearest u = Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 18 / 42

26 EFT for the Horner scheme Let p be a polynomial of degree n with coefficients in F. If no underflow occurs, p(x) = Horner (p, x) + (p π + p σ )(x), with p π (X ) = n 1 i=0 π ix i, p σ (X ) = n 1 i=0 σ ix i, and π i and σ i in F. Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 19 / 42

27 EFT for the Horner scheme Let p be a polynomial of degree n with coefficients in F. If no underflow occurs, p(x) = Horner (p, x) + (p π + p σ )(x), with p π (X ) = n 1 i=0 π ix i, p σ (X ) = n 1 i=0 σ ix i, and π i and σ i in F. Algorithm (Horner scheme) function r 0 = Horner (p, x) r n = a n for i = n 1 : 1 : 0 loop p i = r i+1 x % rounding error π i F r i = p i a i % rounding error σ i F end loop Algorithm (EFT for Horner) function [r 0, p π, p σ ] = EFTHorner (p, x) r n = a n for i = n 1 : 1 : 0 loop [p i, π i ] = TwoProd (r i+1, x) [r i, σ i ] = TwoSum (p i, a i ) p π [i] = π i p σ [i] = σ i end loop Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 19 / 42

28 The compensated Horner algorithm and its accuracy (p π + p σ )(x) is the global error affecting Horner (p, x). we compute an approximate of (p π + p σ )(x) as a correcting term. Algorithm (Compensated Horner algorithm) function r = CompHorner (p, x) [ r, p π, p σ ] = EFTHorner (p, x) % r = Horner (p, x) ĉ = Horner (p π p σ, x) r = r ĉ Theorem Given p a polynomial with floating point coefficients, and x a floating point value, CompHorner (p, x) p(x) / p(x) u + γ 2 2n }{{} 2n 2 u 2 cond(p, x). Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 20 / 42

29 ... as if computed in doubled precision 1 Accuracy of polynomial evaluation [n=25] e-04 γ 2n cond u + γ 2n 2 cond relative forward error 1e-06 1e-08 1e-10 1e-12 1e-14 1e-16 Horner DDHorner CompHorner u 1e-18 1/u 1/u e+10 1e+15 1e+20 1e+25 1e+30 1e+35 condition number Expected accuracy improvement compared to Horner The a priori bound is correct but pessimistic Same accuracy is provided by CompensatedHorner and DDHorner (Horner with inner computation with double-doubles). Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 21 / 42

30 How to validate the accuracy of the computed evaluation? Classic dynamic approaches: Compensated RoT or approximate Wilkinson s running error bound Interval arithmetic Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 22 / 42

31 A dynamic and validated error bound Theorem Given a polynomial p with floating point coefficients, and a floating point value x, we consider res = CompensatedHorner (p, x). The absolute forward error affecting the evaluation is bounded according to CompensatedHorner (p, x) p(x) fl((u res + (γ 4n+2 HornerSum ( p π, p σ, x ) + 2u 2 res ))). The dynamic bound is computed in entire FPA with round to the nearest mode only. The dynamic bound improves the a priori bound. Proof uses EFT and the standard model of FPA (as in Ogita-Rump-Oishi paper) Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 23 / 42

32 The dynamic bound improves the a priori bound Example: evaluating p 5 (x) = (x 1) 5 for 1024 points around x = 1 1e-24 Accuracy of the absolute error bounds 1e-26 Actual forward error A priori error bound Dynamic error bound absolute forward error 1e-28 1e-30 1e-32 1e argument x Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 24 / 42

33 Motivation for faithfully rounding a real value A faithful rounded result = one of the two neighbouring floating point values Interest: sign determination, e.g., for geometric predicates Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 25 / 42

34 Motivation for faithfully rounding a real value A faithful rounded result = one of the two neighbouring floating point values Interest: sign determination, e.g., for geometric predicates 1 Accuracy of the polynomial evaluation with CompHorner [n=50] e-04 relative forward error 1e-06 1e-08 1e-10 1e-12 u + γ 2n 2 cond 1e-14 1e-16 u 1e-18 1/u 1/u e+10 1e+15 1e+20 1e+25 1e+30 1e+35 Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 25 / 42

35 Two sufficient conditions for faithful rounding Let p be a polynomial of degree n, x be a floating point value. Theorem CompHorner (p, x) is a faithful rounding of p(x) while one of the next two bounds is satisfied. An a priori bound for the condition number: cond(p, x) < 1 u u 2 + u γ 2 2n 1/(8n 2 u). A dynamic bound, validated for floating-point evaluation: ( ) γ2n 1 Horner ( p π p σ, x ) fl < u CompHorner (p, x). 1 2(n + 1)u 2 Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 26 / 42

36 Faithful rounding: explanations The previous error bound is too large to prove faithful rounding: CompHorner (p, x) p(x) p(x) u + γ 2 2n }{{} 2n 2 u 2 cond(p, x) We use a result from Rump-Ogita-Oishi (nov. 2005). In practice for IEEE double precision A priori bound: cond up to for n = 20 and up to for n = 100 Dynamic bound: previous bound is improved but still not optimal. Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 27 / 42

37 Checking for faithful Horner Accuracy of the polynomial evaluation with the Horner scheme [n=50] (1-u)/(2+u)uγ 2n -2 1/u 1/u 2 1e-04 relative forward error 1e-06 1e-08 1e-10 1e-12 u + γ 2n 2 cond 1e-14 1e-16 u 1e e+10 1e+15 1e+20 1e+25 1e+30 1e+35 condition number Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 28 / 42

38 1 Compensated algorithms: why and how? 2 Basic bricks towards compensated algorithms 3 Compensated Horner algorithm 4 Performance: arithmetic and processor issues How to benefit from the FMA instruction? How to explain measured performances? 5 Conclusion Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 29 / 42

39 Two compensated Horner algorithms with FMA Left: Same EFT with FMA inside TwoProd: p(x) = Horner (p, x) + (p π + p σ )(x) Right: A variant of previous EFT when FMA is the inner operation of the Horner algorithm: p(x) = HornerFMA (p, x) + (p ε + p ϕ )(x) Algorithm (EFT with FMA) [h, p π, p σ ] = EFTHornerFMA(p, x) s n = a n for i = n 1 : 1 : 0 loop [p i, π i ] = TwoProdFMA(s i+1, x) [s i, σ i ] = TwoSum(p i, a i ) p π [i] = π i p σ [i] = σ i end loop h = s 0 Algorithm (EFT for FMA) [h, p ε, p ϕ ] = EFTHornerFMA(p, x) s n = a n for i = n 1 : 1 : 0 loop [u i, ε i, ϕ i ] = ThreeFMA(u i+1, x, a i ) p ε [i] = ε i p ϕ [i] = ϕ i end loop h = u 0 Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 30 / 42

40 Corresponding results Theorem Given p a polynomial with floating point coefficients, and x a floating point value, we have CompHornerFMA (p, x) p(x) p(x) u + (1 + u)γ n γ 2n cond(p, x) u + 2n 2 u 2 cond(p, x) + O(u 3 ). and CompHornerFMA flops counts is 10n 1. We have also CompHornerThreeFMA (p, x) p(x) p(x) u + (1 + u)γ 2 ncond(p, x) u + n 2 u 2 cond(p, x) + O(u 3 );. and CompHornerThreeFMA flops counts is 19n. Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 31 / 42

41 Accuracy experiments: no surprise 1 1e-2 1e-4 1e-06 γ n cond u + (1+u)γ n 2 cond relative forward error 1e-08 1e-10 1e-12 Horner HornerFMA CompHornerFMA CompHorner3FMA DDHorner 1e-14 1e-16 u 1e e+10 1e+15 1e+20 1e+25 1e+30 1e+35 1e+40 condition number Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 32 / 42

42 For the same output accuracy, prefer FMA to compensate Horner without FMA environment Itanium 1, 733MHz, GCC 2.96 Itanium 2, 900MHz, GCC Itanium 2, 1.6GHz, GCC CompHornerFMA CompHorner3FMA DDHorner HornerFMA HornerFMA HornerFMA mean theo. mean theo. mean theo Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 33 / 42

43 How to explain measured performances? Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 34 / 42

44 How to explain measured performances? Theoretical ratios (flops): CompHorner Horner 10.5 DDHorner Horner 14 DDHorner CompHorner 1.33 Some practical ratios (average running times for degree 5 to 200): CompHorner Horner DDHorner Horner DDHorner CompHorner Pentium 4, 3.00 GHz GCC ICC Athlon 64, 2.00 GHz GCC Itanium 2, 1.4 GHz GCC ICC Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 34 / 42

45 How to explain measured performances? Theoretical ratios (flops): CompHorner Horner 10.5 DDHorner Horner 14 DDHorner CompHorner 1.33 Some practical ratios (average running times for degree 5 to 200): CompHorner Horner DDHorner Horner DDHorner CompHorner Pentium 4, 3.00 GHz GCC ICC Athlon 64, 2.00 GHz GCC Itanium 2, 1.4 GHz GCC ICC Why such difference between theoretical and measured running times? Why does CompHorner run between 2 and 5 times faster than DDHorner? Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 34 / 42

46 What is Instruction-Level Parallelism? All processors since about 1985, including those in the embedded space, use pipelining to overlap the execution of instructions and improve performance. This potential overlap among instructions is called instruction-level parallelism (ILP) since the instruction can be evaluated in parallel. (Hennessy & Patterson) Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 35 / 42

47 What is Instruction-Level Parallelism? All processors since about 1985, including those in the embedded space, use pipelining to overlap the execution of instructions and improve performance. This potential overlap among instructions is called instruction-level parallelism (ILP) since the instruction can be evaluated in parallel. (Hennessy & Patterson) A wide range of techniques exploit the parallelism among instructions: pipelining, superscalar architectures... More ILP thanks to less instruction dependancies if two instructions are parallel they can execute simultaneously in a pipeline, if two instructions are dependent they must be executed in order. Here data dependence is the main source of instruction dependences (no control dependencies nor name dependences). Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 35 / 42

48 Data dependences An instruction i is data dependent on an instruction j if either instruction j produce a result that may be used by instruction i, their exist a chain of dependences of the first type between i and j. j j k i i Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 36 / 42

49 Data dependences An instruction i is data dependent on an instruction j if either instruction j produce a result that may be used by instruction i, their exist a chain of dependences of the first type between i and j. j j k i i If two instructions are data dependent, they cannot execute simultaneously. Dependences are properties of programs: the presence of a data dependence in an instruction sequence reflects a data dependence in the source code. What about the dependences in CompHorner and DDHorner? Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 36 / 42

50 Identification of the difference between CompHorner and DDHorner function r = CompHorner(P, x) s n = a i ; c n = 0 for i = n 1 : 1 : 0 [p i, π i ] = 2Prod(s i+1, x) [s i, σ i ] = 2Sum(p i, a i ) c i = c i+1 x (π i σ i ) end r = s 0 c 0 function r = DDHorner(P, x) sh n = a i ; sl n = 0 for i = n 1 : 1 : 0 %% [ph i, pl i ]=[sh i+1, sl i+1 ] x [th, tl] = 2Prod(sh i+1, x) tl = sl i+1 x tl [ph i, pl i ] = Fast2Sum(th, tl) %% [sh i, sl i ]=[ph i, pl i ] a i [th, tl] = 2Sum(ph i, a i ) tl = tl pl i [sh i, sl i ] = Fast2Sum(th, tl) end r = sh 0 Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 37 / 42

51 In red the only differences between CompHorner and DDHorner function r = CompHorner (P, x) s n = a i ; c n = 0 for i = n 1 : 1 : 0 [p i, π i ] = 2Prod(s i+1, x) t i = c i+1 x π i [s i, σ i ] = 2Sum(p i, a i ) c i = t i σ i end r = s 0 c 0 function r = DDHorner(P, x) sh n = a i ; sl n = 0 for i = n 1 : 1 : 0 %% [ph i, pl i ]=[sh i+1, sl i+1 ] x [th, tl] = 2Prod(sh i+1, x) tl = sl i+1 x tl [ph i, pl i ] = Fast2Sum(th, tl) %% [sh i, sl i ]=[ph i, pl i ] a i [th, tl] = 2Sum(ph i, a i ) tl = tl pl i [sh i, sl i ] = Fast2Sum(th, tl) end r = sh 0 Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 38 / 42

52 Difference in the data flow graph r splitter r x * r CompHorner * 1 * 1 * 1 14 P[i] r 15 x c 2 3 sh x DDHorner sh splitter sh sl x * * We represent all data dependences in the inner loop of each algorithm. r x_lo x_hi P[i] x_hi x_lo x_lo 5 * 8 * * * x_hi * * + + * * The critical path in floating point operations for CompHorner is twice shorter than in DDHorner c ph pl P[i] 23 P[i] + More parallelism among floating point operations in CompHorner than in DDHorner TwoProd, TwoSum, next iteration can be pipelined. Normalisation forbid such ILP sh Thus more potential ILP, and greater practical performance! sl Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 39 / 42

53 1 Compensated algorithms: why and how? 2 Basic bricks towards compensated algorithms 3 Compensated Horner algorithm 4 Performance: arithmetic and processor issues 5 Conclusion Summary and work in progress Acknowledgements Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 40 / 42

54 To finish... Main message: Compensated algorithms are an interesting alternative to existing librairies as double or quad-double accurary as if computed with K times the available precision, efficiency in term of running-time without too much portability sacrifice since only working with IEEE-754 precisions: single, double; dynamic bound to control the accuracy of the compensated result. Some work in progress: GPU and Sony-IBM Cell: new exotic processors are extremely powerful architectures but only in single precision! Highly accurate Horner schema thanks to compensation and faithful summation of Rump-Ogita-Horner. Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 41 / 42

55 Acknowledgements SCAN 06 organizers and Professor W. Luther in particular Stef Graillat and Nicolas Louvet go to his talk this afternoon at 15:15 Professor B. Goossens and D. Parello for their expertise in micro-architecture and compiler optimisation Rump-Ogita-Oishi recent papers for the motivation of these developments. Philippe LANGLOIS (UPVD) 4ccurate 4lgorithms in Floating Point 4rithmetic SCAN 2006 at Duisburg 42 / 42

Solving Triangular Systems More Accurately and Efficiently

Solving Triangular Systems More Accurately and Efficiently 17th IMACS World Congress, July 11-15, 2005, Paris, France Scientific Computation, Applied Mathematics and Simulation Solving Triangular Systems More Accurately and Efficiently Philippe LANGLOIS and Nicolas

More information

Faithful Horner Algorithm

Faithful Horner Algorithm ICIAM 07, Zurich, Switzerland, 16 20 July 2007 Faithful Horner Algorithm Philippe Langlois, Nicolas Louvet Université de Perpignan, France http://webdali.univ-perp.fr Ph. Langlois (Université de Perpignan)

More information

Accurate polynomial evaluation in floating point arithmetic

Accurate polynomial evaluation in floating point arithmetic in floating point arithmetic Université de Perpignan Via Domitia Laboratoire LP2A Équipe de recherche en Informatique DALI MIMS Seminar, February, 10 th 2006 General motivation Provide numerical algorithms

More information

How to Ensure a Faithful Polynomial Evaluation with the Compensated Horner Algorithm

How to Ensure a Faithful Polynomial Evaluation with the Compensated Horner Algorithm How to Ensure a Faithful Polynomial Evaluation with the Compensated Horner Algorithm Philippe Langlois, Nicolas Louvet Université de Perpignan, DALI Research Team {langlois, nicolas.louvet}@univ-perp.fr

More information

Accurate Solution of Triangular Linear System

Accurate Solution of Triangular Linear System SCAN 2008 Sep. 29 - Oct. 3, 2008, at El Paso, TX, USA Accurate Solution of Triangular Linear System Philippe Langlois DALI at University of Perpignan France Nicolas Louvet INRIA and LIP at ENS Lyon France

More information

Algorithms for Accurate, Validated and Fast Polynomial Evaluation

Algorithms for Accurate, Validated and Fast Polynomial Evaluation Algorithms for Accurate, Validated and Fast Polynomial Evaluation Stef Graillat, Philippe Langlois, Nicolas Louvet Abstract: We survey a class of algorithms to evaluate polynomials with oating point coecients

More information

Compensated Horner Scheme

Compensated Horner Scheme Compensated Horner Scheme S. Graillat 1, Philippe Langlois 1, Nicolas Louvet 1 DALI-LP2A Laboratory. Université de Perpignan Via Domitia. firstname.lastname@univ-perp.fr, http://webdali.univ-perp.fr Abstract.

More information

Computing Time for Summation Algorithm: Less Hazard and More Scientific Research

Computing Time for Summation Algorithm: Less Hazard and More Scientific Research Computing Time for Summation Algorithm: Less Hazard and More Scientific Research Bernard Goossens, Philippe Langlois, David Parello, Kathy Porada To cite this version: Bernard Goossens, Philippe Langlois,

More information

An accurate algorithm for evaluating rational functions

An accurate algorithm for evaluating rational functions An accurate algorithm for evaluating rational functions Stef Graillat To cite this version: Stef Graillat. An accurate algorithm for evaluating rational functions. 2017. HAL Id: hal-01578486

More information

Improving the Compensated Horner Scheme with a Fused Multiply and Add

Improving the Compensated Horner Scheme with a Fused Multiply and Add Équipe de Recherche DALI Laboratoire LP2A, EA 3679 Université de Perpignan Via Domitia Improving the Compensated Horner Scheme with a Fused Multiply and Add S. Graillat, Ph. Langlois, N. Louvet DALI-LP2A

More information

Compensated Horner scheme in complex floating point arithmetic

Compensated Horner scheme in complex floating point arithmetic Compensated Horner scheme in complex floating point arithmetic Stef Graillat, Valérie Ménissier-Morain UPMC Univ Paris 06, UMR 7606, LIP6 4 place Jussieu, F-75252, Paris cedex 05, France stef.graillat@lip6.fr,valerie.menissier-morain@lip6.fr

More information

ACCURATE SUM AND DOT PRODUCT

ACCURATE SUM AND DOT PRODUCT ACCURATE SUM AND DOT PRODUCT TAKESHI OGITA, SIEGFRIED M. RUMP, AND SHIN ICHI OISHI Abstract. Algorithms for summation and dot product of floating point numbers are presented which are fast in terms of

More information

Accurate Floating Point Product and Exponentiation

Accurate Floating Point Product and Exponentiation Accurate Floating Point Product and Exponentiation Stef Graillat To cite this version: Stef Graillat. Accurate Floating Point Product and Exponentiation. IEEE Transactions on Computers, Institute of Electrical

More information

Computation of dot products in finite fields with floating-point arithmetic

Computation of dot products in finite fields with floating-point arithmetic Computation of dot products in finite fields with floating-point arithmetic Stef Graillat Joint work with Jérémy Jean LIP6/PEQUAN - Université Pierre et Marie Curie (Paris 6) - CNRS Computer-assisted proofs

More information

Adaptive and Efficient Algorithm for 2D Orientation Problem

Adaptive and Efficient Algorithm for 2D Orientation Problem Japan J. Indust. Appl. Math., 26 (2009), 215 231 Area 2 Adaptive and Efficient Algorithm for 2D Orientation Problem Katsuhisa Ozaki, Takeshi Ogita, Siegfried M. Rump and Shin ichi Oishi Research Institute

More information

Floating Point Arithmetic and Rounding Error Analysis

Floating Point Arithmetic and Rounding Error Analysis Floating Point Arithmetic and Rounding Error Analysis Claude-Pierre Jeannerod Nathalie Revol Inria LIP, ENS de Lyon 2 Context Starting point: How do numerical algorithms behave in nite precision arithmetic?

More information

Computation of the error functions erf and erfc in arbitrary precision with correct rounding

Computation of the error functions erf and erfc in arbitrary precision with correct rounding Computation of the error functions erf and erfc in arbitrary precision with correct rounding Sylvain Chevillard Arenaire, LIP, ENS-Lyon, France Sylvain.Chevillard@ens-lyon.fr Nathalie Revol INRIA, Arenaire,

More information

Reproducible, Accurately Rounded and Efficient BLAS

Reproducible, Accurately Rounded and Efficient BLAS Reproducible, Accurately Rounded and Efficient BLAS Chemseddine Chohra, Philippe Langlois, David Parello To cite this version: Chemseddine Chohra, Philippe Langlois, David Parello. Reproducible, Accurately

More information

Automatic Verified Numerical Computations for Linear Systems

Automatic Verified Numerical Computations for Linear Systems Automatic Verified Numerical Computations for Linear Systems Katsuhisa Ozaki (Shibaura Institute of Technology) joint work with Takeshi Ogita (Tokyo Woman s Christian University) Shin ichi Oishi (Waseda

More information

Implementation of float float operators on graphic hardware

Implementation of float float operators on graphic hardware Implementation of float float operators on graphic hardware Guillaume Da Graça David Defour DALI, Université de Perpignan Outline Why GPU? Floating point arithmetic on GPU Float float format Problem &

More information

ACCURATE FLOATING-POINT SUMMATION PART II: SIGN, K-FOLD FAITHFUL AND ROUNDING TO NEAREST

ACCURATE FLOATING-POINT SUMMATION PART II: SIGN, K-FOLD FAITHFUL AND ROUNDING TO NEAREST submitted for publication in SISC, November 13, 2005, revised April 13, 2007 and April 15, 2008, accepted August 21, 2008; appeared SIAM J. Sci. Comput. Vol. 31, Issue 2, pp. 1269-1302 (2008) ACCURATE

More information

Optimizing Scientific Libraries for the Itanium

Optimizing Scientific Libraries for the Itanium 0 Optimizing Scientific Libraries for the Itanium John Harrison Intel Corporation Gelato Federation Meeting, HP Cupertino May 25, 2005 1 Quick summary Intel supplies drop-in replacement versions of common

More information

Formal verification of IA-64 division algorithms

Formal verification of IA-64 division algorithms Formal verification of IA-64 division algorithms 1 Formal verification of IA-64 division algorithms John Harrison Intel Corporation IA-64 overview HOL Light overview IEEE correctness Division on IA-64

More information

Extended precision with a rounding mode toward zero environment. Application on the CELL processor

Extended precision with a rounding mode toward zero environment. Application on the CELL processor Extended precision with a rounding mode toward zero environment. Application on the CELL processor Hong Diep Nguyen (hong.diep.nguyen@ens-lyon.fr), Stef Graillat (stef.graillat@lip6.fr), Jean-Luc Lamotte

More information

MANY numerical problems in dynamical systems

MANY numerical problems in dynamical systems IEEE TRANSACTIONS ON COMPUTERS, VOL., 201X 1 Arithmetic algorithms for extended precision using floating-point expansions Mioara Joldeş, Olivier Marty, Jean-Michel Muller and Valentina Popescu Abstract

More information

INVERSION OF EXTREMELY ILL-CONDITIONED MATRICES IN FLOATING-POINT

INVERSION OF EXTREMELY ILL-CONDITIONED MATRICES IN FLOATING-POINT submitted for publication in JJIAM, March 15, 28 INVERSION OF EXTREMELY ILL-CONDITIONED MATRICES IN FLOATING-POINT SIEGFRIED M. RUMP Abstract. Let an n n matrix A of floating-point numbers in some format

More information

A new multiplication algorithm for extended precision using floating-point expansions. Valentina Popescu, Jean-Michel Muller,Ping Tak Peter Tang

A new multiplication algorithm for extended precision using floating-point expansions. Valentina Popescu, Jean-Michel Muller,Ping Tak Peter Tang A new multiplication algorithm for extended precision using floating-point expansions Valentina Popescu, Jean-Michel Muller,Ping Tak Peter Tang ARITH 23 July 2016 AMPAR CudA Multiple Precision ARithmetic

More information

Convergence of Rump s Method for Inverting Arbitrarily Ill-Conditioned Matrices

Convergence of Rump s Method for Inverting Arbitrarily Ill-Conditioned Matrices published in J. Comput. Appl. Math., 205(1):533 544, 2007 Convergence of Rump s Method for Inverting Arbitrarily Ill-Conditioned Matrices Shin ichi Oishi a,b Kunio Tanabe a Takeshi Ogita b,a Siegfried

More information

Automated design of floating-point logarithm functions on integer processors

Automated design of floating-point logarithm functions on integer processors 23rd IEEE Symposium on Computer Arithmetic Santa Clara, CA, USA, 10-13 July 2016 Automated design of floating-point logarithm functions on integer processors Guillaume Revy (presented by Florent de Dinechin)

More information

On the computation of the reciprocal of floating point expansions using an adapted Newton-Raphson iteration

On the computation of the reciprocal of floating point expansions using an adapted Newton-Raphson iteration On the computation of the reciprocal of floating point expansions using an adapted Newton-Raphson iteration Mioara Joldes, Valentina Popescu, Jean-Michel Muller ASAP 2014 1 / 10 Motivation Numerical problems

More information

On various ways to split a floating-point number

On various ways to split a floating-point number On various ways to split a floating-point number Claude-Pierre Jeannerod Jean-Michel Muller Paul Zimmermann Inria, CNRS, ENS Lyon, Université de Lyon, Université de Lorraine France ARITH-25 June 2018 -2-

More information

Optimizing the Representation of Intervals

Optimizing the Representation of Intervals Optimizing the Representation of Intervals Javier D. Bruguera University of Santiago de Compostela, Spain Numerical Sofware: Design, Analysis and Verification Santander, Spain, July 4-6 2012 Contents 1

More information

Newton-Raphson Algorithms for Floating-Point Division Using an FMA

Newton-Raphson Algorithms for Floating-Point Division Using an FMA Newton-Raphson Algorithms for Floating-Point Division Using an FMA Nicolas Louvet, Jean-Michel Muller, Adrien Panhaleux Abstract Since the introduction of the Fused Multiply and Add (FMA) in the IEEE-754-2008

More information

Towards Fast, Accurate and Reproducible LU Factorization

Towards Fast, Accurate and Reproducible LU Factorization Towards Fast, Accurate and Reproducible LU Factorization Roman Iakymchuk 1, David Defour 2, and Stef Graillat 3 1 KTH Royal Institute of Technology, CSC, CST/PDC 2 Université de Perpignan, DALI LIRMM 3

More information

Some issues related to double rounding

Some issues related to double rounding Noname manuscript No. will be inserted by the editor) Some issues related to double rounding Érik Martin-Dorel Guillaume Melquiond Jean-Michel Muller Received: date / Accepted: date Abstract Double rounding

More information

ERROR ESTIMATION OF FLOATING-POINT SUMMATION AND DOT PRODUCT

ERROR ESTIMATION OF FLOATING-POINT SUMMATION AND DOT PRODUCT accepted for publication in BIT, May 18, 2011. ERROR ESTIMATION OF FLOATING-POINT SUMMATION AND DOT PRODUCT SIEGFRIED M. RUMP Abstract. We improve the well-known Wilkinson-type estimates for the error

More information

Parallel Reproducible Summation

Parallel Reproducible Summation Parallel Reproducible Summation James Demmel Mathematics Department and CS Division University of California at Berkeley Berkeley, CA 94720 demmel@eecs.berkeley.edu Hong Diep Nguyen EECS Department University

More information

Parallel Polynomial Evaluation

Parallel Polynomial Evaluation Parallel Polynomial Evaluation Jan Verschelde joint work with Genady Yoffe University of Illinois at Chicago Department of Mathematics, Statistics, and Computer Science http://www.math.uic.edu/ jan jan@math.uic.edu

More information

Continued fractions and number systems: applications to correctly-rounded implementations of elementary functions and modular arithmetic.

Continued fractions and number systems: applications to correctly-rounded implementations of elementary functions and modular arithmetic. Continued fractions and number systems: applications to correctly-rounded implementations of elementary functions and modular arithmetic. Mourad Gouicem PEQUAN Team, LIP6/UPMC Nancy, France May 28 th 2013

More information

Error Bounds for Iterative Refinement in Three Precisions

Error Bounds for Iterative Refinement in Three Precisions Error Bounds for Iterative Refinement in Three Precisions Erin C. Carson, New York University Nicholas J. Higham, University of Manchester SIAM Annual Meeting Portland, Oregon July 13, 018 Hardware Support

More information

Faithfully Rounded Floating-point Computations

Faithfully Rounded Floating-point Computations 1 Faithfully Rounded Floating-point Computations MARKO LANGE, Waseda University SIEGFRIED M. RUMP, Hamburg University of Technology We present a pair arithmetic for the four basic operations and square

More information

Verification methods for linear systems using ufp estimation with rounding-to-nearest

Verification methods for linear systems using ufp estimation with rounding-to-nearest NOLTA, IEICE Paper Verification methods for linear systems using ufp estimation with rounding-to-nearest Yusuke Morikura 1a), Katsuhisa Ozaki 2,4, and Shin ichi Oishi 3,4 1 Graduate School of Fundamental

More information

Tight and rigourous error bounds for basic building blocks of double-word arithmetic. Mioara Joldes, Jean-Michel Muller, Valentina Popescu

Tight and rigourous error bounds for basic building blocks of double-word arithmetic. Mioara Joldes, Jean-Michel Muller, Valentina Popescu Tight and rigourous error bounds for basic building blocks of double-word arithmetic Mioara Joldes, Jean-Michel Muller, Valentina Popescu SCAN - September 2016 AMPAR CudA Multiple Precision ARithmetic

More information

Formal Verification of Mathematical Algorithms

Formal Verification of Mathematical Algorithms Formal Verification of Mathematical Algorithms 1 Formal Verification of Mathematical Algorithms John Harrison Intel Corporation The cost of bugs Formal verification Levels of verification HOL Light Formalizing

More information

1 Floating point arithmetic

1 Floating point arithmetic Introduction to Floating Point Arithmetic Floating point arithmetic Floating point representation (scientific notation) of numbers, for example, takes the following form.346 0 sign fraction base exponent

More information

Getting tight error bounds in floating-point arithmetic: illustration with complex functions, and the real x n function

Getting tight error bounds in floating-point arithmetic: illustration with complex functions, and the real x n function Getting tight error bounds in floating-point arithmetic: illustration with complex functions, and the real x n function Jean-Michel Muller collaborators: S. Graillat, C.-P. Jeannerod, N. Louvet V. Lefèvre

More information

FAST VERIFICATION OF SOLUTIONS OF MATRIX EQUATIONS

FAST VERIFICATION OF SOLUTIONS OF MATRIX EQUATIONS published in Numer. Math., 90(4):755 773, 2002 FAST VERIFICATION OF SOLUTIONS OF MATRIX EQUATIONS SHIN ICHI OISHI AND SIEGFRIED M. RUMP Abstract. In this paper, we are concerned with a matrix equation

More information

SRT Division and the Pentium FDIV Bug (draft lecture notes, CSCI P415)

SRT Division and the Pentium FDIV Bug (draft lecture notes, CSCI P415) SRT Division and the Pentium FDIV Bug (draft lecture notes, CSCI P4) Steven D. Johnson September 0, 000 Abstract This talk explains the widely publicized design error in a 994 issue of the Intel Corp.

More information

INF2270 Spring Philipp Häfliger. Lecture 8: Superscalar CPUs, Course Summary/Repetition (1/2)

INF2270 Spring Philipp Häfliger. Lecture 8: Superscalar CPUs, Course Summary/Repetition (1/2) INF2270 Spring 2010 Philipp Häfliger Summary/Repetition (1/2) content From Scalar to Superscalar Lecture Summary and Brief Repetition Binary numbers Boolean Algebra Combinational Logic Circuits Encoder/Decoder

More information

Homework 2 Foundations of Computational Math 1 Fall 2018

Homework 2 Foundations of Computational Math 1 Fall 2018 Homework 2 Foundations of Computational Math 1 Fall 2018 Note that Problems 2 and 8 have coding in them. Problem 2 is a simple task while Problem 8 is very involved (and has in fact been given as a programming

More information

1 Backward and Forward Error

1 Backward and Forward Error Math 515 Fall, 2008 Brief Notes on Conditioning, Stability and Finite Precision Arithmetic Most books on numerical analysis, numerical linear algebra, and matrix computations have a lot of material covering

More information

Lecture 7. Floating point arithmetic and stability

Lecture 7. Floating point arithmetic and stability Lecture 7 Floating point arithmetic and stability 2.5 Machine representation of numbers Scientific notation: 23 }{{} }{{} } 3.14159265 {{} }{{} 10 sign mantissa base exponent (significand) s m β e A floating

More information

Hierarchical Approach for Deriving a Reproducible LU factorization

Hierarchical Approach for Deriving a Reproducible LU factorization Hierarchical Approach for Deriving a Reproducible LU factorization Roman Iakymchuk, Stef Graillat, David Defour, Erwin Laure, Enrique Quintana-Ortí To cite this version: Roman Iakymchuk, Stef Graillat,

More information

9. Datapath Design. Jacob Abraham. Department of Electrical and Computer Engineering The University of Texas at Austin VLSI Design Fall 2017

9. Datapath Design. Jacob Abraham. Department of Electrical and Computer Engineering The University of Texas at Austin VLSI Design Fall 2017 9. Datapath Design Jacob Abraham Department of Electrical and Computer Engineering The University of Texas at Austin VLSI Design Fall 2017 October 2, 2017 ECE Department, University of Texas at Austin

More information

Automating the Verification of Floating-point Algorithms

Automating the Verification of Floating-point Algorithms Introduction Interval+Error Advanced Gappa Conclusion Automating the Verification of Floating-point Algorithms Guillaume Melquiond Inria Saclay Île-de-France LRI, Université Paris Sud, CNRS 2014-07-18

More information

arxiv: v1 [cs.na] 8 Feb 2016

arxiv: v1 [cs.na] 8 Feb 2016 Toom-Coo Multiplication: Some Theoretical and Practical Aspects arxiv:1602.02740v1 [cs.na] 8 Feb 2016 M.J. Kronenburg Abstract Toom-Coo multiprecision multiplication is a well-nown multiprecision multiplication

More information

CME 302: NUMERICAL LINEAR ALGEBRA FALL 2005/06 LECTURE 5. Ax = b.

CME 302: NUMERICAL LINEAR ALGEBRA FALL 2005/06 LECTURE 5. Ax = b. CME 302: NUMERICAL LINEAR ALGEBRA FALL 2005/06 LECTURE 5 GENE H GOLUB Suppose we want to solve We actually have an approximation ξ such that 1 Perturbation Theory Ax = b x = ξ + e The question is, how

More information

Numerical Program Optimization by Automatic Improvement of the Accuracy of Computations. Nasrine Damouche* and Matthieu Martel

Numerical Program Optimization by Automatic Improvement of the Accuracy of Computations. Nasrine Damouche* and Matthieu Martel Int. J. of Intelligent Engineering Informatics, Vol. x, No. x, 1 26 1 Numerical Program Optimization by Automatic Improvement of the Accuracy of Computations Nasrine Damouche* and Matthieu Martel Université

More information

Math 411 Preliminaries

Math 411 Preliminaries Math 411 Preliminaries Provide a list of preliminary vocabulary and concepts Preliminary Basic Netwon s method, Taylor series expansion (for single and multiple variables), Eigenvalue, Eigenvector, Vector

More information

GPU acceleration of Newton s method for large systems of polynomial equations in double double and quad double arithmetic

GPU acceleration of Newton s method for large systems of polynomial equations in double double and quad double arithmetic GPU acceleration of Newton s method for large systems of polynomial equations in double double and quad double arithmetic Jan Verschelde joint work with Xiangcheng Yu University of Illinois at Chicago

More information

Faster arithmetic for number-theoretic transforms

Faster arithmetic for number-theoretic transforms University of New South Wales 7th October 2011, Macquarie University Plan for talk 1. Review number-theoretic transform (NTT) 2. Discuss typical butterfly algorithm 3. Improvements to butterfly algorithm

More information

Computing correctly rounded logarithms with fixed-point operations. Julien Le Maire, Florent de Dinechin, Jean-Michel Muller and Nicolas Brunie

Computing correctly rounded logarithms with fixed-point operations. Julien Le Maire, Florent de Dinechin, Jean-Michel Muller and Nicolas Brunie Computing correctly rounded logarithms with fixed-point operations Julien Le Maire, Florent de Dinechin, Jean-Michel Muller and Nicolas Brunie Outline Introduction and context Algorithm Results and comparisons

More information

CS 700: Quantitative Methods & Experimental Design in Computer Science

CS 700: Quantitative Methods & Experimental Design in Computer Science CS 700: Quantitative Methods & Experimental Design in Computer Science Sanjeev Setia Dept of Computer Science George Mason University Logistics Grade: 35% project, 25% Homework assignments 20% midterm,

More information

Calculate Sensitivity Function Using Parallel Algorithm

Calculate Sensitivity Function Using Parallel Algorithm Journal of Computer Science 4 (): 928-933, 28 ISSN 549-3636 28 Science Publications Calculate Sensitivity Function Using Parallel Algorithm Hamed Al Rjoub Irbid National University, Irbid, Jordan Abstract:

More information

Numerics and Error Analysis

Numerics and Error Analysis Numerics and Error Analysis CS 205A: Mathematical Methods for Robotics, Vision, and Graphics Doug James (and Justin Solomon) CS 205A: Mathematical Methods Numerics and Error Analysis 1 / 30 A Puzzle What

More information

Fast and accurate Bessel function computation

Fast and accurate Bessel function computation 0 Fast and accurate Bessel function computation John Harrison, Intel Corporation ARITH-19 Portland, OR Tue 9th June 2009 (11:00 11:30) 1 Bessel functions and their computation Bessel functions are certain

More information

Round-off error propagation and non-determinism in parallel applications

Round-off error propagation and non-determinism in parallel applications Round-off error propagation and non-determinism in parallel applications Vincent Baudoui (Argonne/Total SA) vincent.baudoui@gmail.com Franck Cappello (Argonne/INRIA/UIUC-NCSA) Georges Oppenheim (Paris-Sud

More information

Chapter 4 No. 4.0 Answer True or False to the following. Give reasons for your answers.

Chapter 4 No. 4.0 Answer True or False to the following. Give reasons for your answers. MATH 434/534 Theoretical Assignment 3 Solution Chapter 4 No 40 Answer True or False to the following Give reasons for your answers If a backward stable algorithm is applied to a computational problem,

More information

Gaussian Elimination for Linear Systems

Gaussian Elimination for Linear Systems Gaussian Elimination for Linear Systems Tsung-Ming Huang Department of Mathematics National Taiwan Normal University October 3, 2011 1/56 Outline 1 Elementary matrices 2 LR-factorization 3 Gaussian elimination

More information

McBits: Fast code-based cryptography

McBits: Fast code-based cryptography McBits: Fast code-based cryptography Peter Schwabe Radboud University Nijmegen, The Netherlands Joint work with Daniel Bernstein, Tung Chou December 17, 2013 IMA International Conference on Cryptography

More information

Compute the behavior of reality even if it is impossible to observe the processes (for example a black hole in astrophysics).

Compute the behavior of reality even if it is impossible to observe the processes (for example a black hole in astrophysics). 1 Introduction Read sections 1.1, 1.2.1 1.2.4, 1.2.6, 1.3.8, 1.3.9, 1.4. Review questions 1.1 1.6, 1.12 1.21, 1.37. The subject of Scientific Computing is to simulate the reality. Simulation is the representation

More information

Performance Metrics for Computer Systems. CASS 2018 Lavanya Ramapantulu

Performance Metrics for Computer Systems. CASS 2018 Lavanya Ramapantulu Performance Metrics for Computer Systems CASS 2018 Lavanya Ramapantulu Eight Great Ideas in Computer Architecture Design for Moore s Law Use abstraction to simplify design Make the common case fast Performance

More information

Exact Determinant of Integer Matrices

Exact Determinant of Integer Matrices Takeshi Ogita Department of Mathematical Sciences, Tokyo Woman s Christian University Tokyo 167-8585, Japan, ogita@lab.twcu.ac.jp Abstract. This paper is concerned with the numerical computation of the

More information

The Classical Relative Error Bounds for Computing a2 + b 2 and c/ a 2 + b 2 in Binary Floating-Point Arithmetic are Asymptotically Optimal

The Classical Relative Error Bounds for Computing a2 + b 2 and c/ a 2 + b 2 in Binary Floating-Point Arithmetic are Asymptotically Optimal -1- The Classical Relative Error Bounds for Computing a2 + b 2 and c/ a 2 + b 2 in Binary Floating-Point Arithmetic are Asymptotically Optimal Claude-Pierre Jeannerod Jean-Michel Muller Antoine Plet Inria,

More information

The Euclidean Division Implemented with a Floating-Point Multiplication and a Floor

The Euclidean Division Implemented with a Floating-Point Multiplication and a Floor The Euclidean Division Implemented with a Floating-Point Multiplication and a Floor Vincent Lefèvre 11th July 2005 Abstract This paper is a complement of the research report The Euclidean division implemented

More information

Isolating critical cases for reciprocals using integer factorization. John Harrison Intel Corporation ARITH-16 Santiago de Compostela 17th June 2003

Isolating critical cases for reciprocals using integer factorization. John Harrison Intel Corporation ARITH-16 Santiago de Compostela 17th June 2003 0 Isolating critical cases for reciprocals using integer factorization John Harrison Intel Corporation ARITH-16 Santiago de Compostela 17th June 2003 1 result before the final rounding Background Suppose

More information

Numerical Linear Algebra

Numerical Linear Algebra Numerical Linear Algebra Decompositions, numerical aspects Gerard Sleijpen and Martin van Gijzen September 27, 2017 1 Delft University of Technology Program Lecture 2 LU-decomposition Basic algorithm Cost

More information

Program Lecture 2. Numerical Linear Algebra. Gaussian elimination (2) Gaussian elimination. Decompositions, numerical aspects

Program Lecture 2. Numerical Linear Algebra. Gaussian elimination (2) Gaussian elimination. Decompositions, numerical aspects Numerical Linear Algebra Decompositions, numerical aspects Program Lecture 2 LU-decomposition Basic algorithm Cost Stability Pivoting Cholesky decomposition Sparse matrices and reorderings Gerard Sleijpen

More information

Propagation of Roundoff Errors in Finite Precision Computations: a Semantics Approach 1

Propagation of Roundoff Errors in Finite Precision Computations: a Semantics Approach 1 Propagation of Roundoff Errors in Finite Precision Computations: a Semantics Approach 1 Matthieu Martel CEA - Recherche Technologique LIST-DTSI-SLA CEA F91191 Gif-Sur-Yvette Cedex, France e-mail : mmartel@cea.fr

More information

Accelerating linear algebra computations with hybrid GPU-multicore systems.

Accelerating linear algebra computations with hybrid GPU-multicore systems. Accelerating linear algebra computations with hybrid GPU-multicore systems. Marc Baboulin INRIA/Université Paris-Sud joint work with Jack Dongarra (University of Tennessee and Oak Ridge National Laboratory)

More information

Jim Lambers MAT 610 Summer Session Lecture 2 Notes

Jim Lambers MAT 610 Summer Session Lecture 2 Notes Jim Lambers MAT 610 Summer Session 2009-10 Lecture 2 Notes These notes correspond to Sections 2.2-2.4 in the text. Vector Norms Given vectors x and y of length one, which are simply scalars x and y, the

More information

Skew-Tolerant Circuit Design

Skew-Tolerant Circuit Design Skew-Tolerant Circuit Design David Harris David_Harris@hmc.edu December, 2000 Harvey Mudd College Claremont, CA Outline Introduction Skew-Tolerant Circuits Traditional Domino Circuits Skew-Tolerant Domino

More information

1.1 COMPUTER REPRESENTATION OF NUM- BERS, REPRESENTATION ERRORS

1.1 COMPUTER REPRESENTATION OF NUM- BERS, REPRESENTATION ERRORS Chapter 1 NUMBER REPRESENTATION, ERROR ANALYSIS 1.1 COMPUTER REPRESENTATION OF NUM- BERS, REPRESENTATION ERRORS Floating-point representation x t,r of a number x: x t,r = m t P cr, where: P - base (the

More information

Elements of Floating-point Arithmetic

Elements of Floating-point Arithmetic Elements of Floating-point Arithmetic Sanzheng Qiao Department of Computing and Software McMaster University July, 2012 Outline 1 Floating-point Numbers Representations IEEE Floating-point Standards Underflow

More information

Dense LU factorization and its error analysis

Dense LU factorization and its error analysis Dense LU factorization and its error analysis Laura Grigori INRIA and LJLL, UPMC February 2016 Plan Basis of floating point arithmetic and stability analysis Notation, results, proofs taken from [N.J.Higham,

More information

FLOATING POINT ARITHMETHIC - ERROR ANALYSIS

FLOATING POINT ARITHMETHIC - ERROR ANALYSIS FLOATING POINT ARITHMETHIC - ERROR ANALYSIS Brief review of floating point arithmetic Model of floating point arithmetic Notation, backward and forward errors 3-1 Roundoff errors and floating-point arithmetic

More information

Representable correcting terms for possibly underflowing floating point operations

Representable correcting terms for possibly underflowing floating point operations Representable correcting terms for possibly underflowing floating point operations Sylvie Boldo & Marc Daumas E-mail: Sylvie.Boldo@ENS-Lyon.Fr & Marc.Daumas@ENS-Lyon.Fr Laboratoire de l Informatique du

More information

PowerPoints organized by Dr. Michael R. Gustafson II, Duke University

PowerPoints organized by Dr. Michael R. Gustafson II, Duke University Part 1 Chapter 4 Roundoff and Truncation Errors PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright The McGraw-Hill Companies, Inc. Permission required for reproduction

More information

FLOATING POINT ARITHMETHIC - ERROR ANALYSIS

FLOATING POINT ARITHMETHIC - ERROR ANALYSIS FLOATING POINT ARITHMETHIC - ERROR ANALYSIS Brief review of floating point arithmetic Model of floating point arithmetic Notation, backward and forward errors Roundoff errors and floating-point arithmetic

More information

Fall 2008 CSE Qualifying Exam. September 13, 2008

Fall 2008 CSE Qualifying Exam. September 13, 2008 Fall 2008 CSE Qualifying Exam September 13, 2008 1 Architecture 1. (Quan, Fall 2008) Your company has just bought a new dual Pentium processor, and you have been tasked with optimizing your software for

More information

Notes on floating point number, numerical computations and pitfalls

Notes on floating point number, numerical computations and pitfalls Notes on floating point number, numerical computations and pitfalls November 6, 212 1 Floating point numbers An n-digit floating point number in base β has the form x = ±(.d 1 d 2 d n ) β β e where.d 1

More information

4.2 Floating-Point Numbers

4.2 Floating-Point Numbers 101 Approximation 4.2 Floating-Point Numbers 4.2 Floating-Point Numbers The number 3.1416 in scientific notation is 0.31416 10 1 or (as computer output) -0.31416E01..31416 10 1 exponent sign mantissa base

More information

An Introduction to Differential Algebra

An Introduction to Differential Algebra An Introduction to Differential Algebra Alexander Wittig1, P. Di Lizia, R. Armellin, et al. 1 ESA Advanced Concepts Team (TEC-SF) SRL, Milan Dinamica Outline 1 Overview Five Views of Differential Algebra

More information

EECS150 - Digital Design Lecture 27 - misc2

EECS150 - Digital Design Lecture 27 - misc2 EECS150 - Digital Design Lecture 27 - misc2 May 1, 2002 John Wawrzynek Spring 2002 EECS150 - Lec27-misc2 Page 1 Outline Linear Feedback Shift Registers Theory and practice Simple hardware division algorithms

More information

Floating Point Number Systems. Simon Fraser University Surrey Campus MACM 316 Spring 2005 Instructor: Ha Le

Floating Point Number Systems. Simon Fraser University Surrey Campus MACM 316 Spring 2005 Instructor: Ha Le Floating Point Number Systems Simon Fraser University Surrey Campus MACM 316 Spring 2005 Instructor: Ha Le 1 Overview Real number system Examples Absolute and relative errors Floating point numbers Roundoff

More information

Measurement & Performance

Measurement & Performance Measurement & Performance Timers Performance measures Time-based metrics Rate-based metrics Benchmarking Amdahl s law Topics 2 Page The Nature of Time real (i.e. wall clock) time = User Time: time spent

More information

Can You Count on Your Computer?

Can You Count on Your Computer? Can You Count on Your Computer? Professor Nick Higham School of Mathematics University of Manchester higham@ma.man.ac.uk http://www.ma.man.ac.uk/~higham/ p. 1/33 p. 2/33 Counting to Six I asked my computer

More information

Measurement & Performance

Measurement & Performance Measurement & Performance Topics Timers Performance measures Time-based metrics Rate-based metrics Benchmarking Amdahl s law 2 The Nature of Time real (i.e. wall clock) time = User Time: time spent executing

More information

Program 1 Foundations of Computational Math 1 Fall 2018

Program 1 Foundations of Computational Math 1 Fall 2018 Program 1 Foundations of Computational Math 1 Fall 2018 Due date: 11:59PM on Friday, 28 September 2018 Written Exercises Problem 1 Consider the summation σ = n ξ i using the following binary fan-in tree

More information