Rigorous Estimation of Floating- point Round- off Errors with Symbolic Taylor Expansions

Size: px
Start display at page:

Download "Rigorous Estimation of Floating- point Round- off Errors with Symbolic Taylor Expansions"

Transcription

1 Rigorous Estimation of Floating- point Round- off Errors with Symbolic Taylor Expansions Alexey Solovyev, Charles Jacobsen Zvonimir Rakamaric, and Ganesh Gopalakrishnan School of Computing, University of Utah, Salt Lake City, Utah, USA

2 Floating-point (FP) numbers Used for a very long time Zuse Z1 (~1938), and even before Standardized, esp since 1985 (IEEE) Standardization is mainly for portable behavior Portable confusion too J Does NOT make FP inherently simpler to reason about FP behavior remains highly non-intuitive, non-compositional, 2

3 Floating-point (FP) numbers Used for a very long time Zuse Z1 (~1938), and even before Standardized, esp since 1985 (IEEE) Standardization is mainly for portable behavior Portable confusion too J Does NOT make FP inherently simpler to reason about FP behavior remains highly non-intuitive, non-compositional, 3

4 Floating-point (FP) numbers Used for a very long time Zuse Z1 (~1938), and even before Standardized, esp since 1985 (IEEE) Standardization is mainly for portable behavior Portable confusion too J Does NOT make FP inherently simpler to reason about FP behavior remains highly non-intuitive, non-compositional, 4

5 Example: Let s do reduction using OpenMP to realize dot-product 5

6 Example: Let s do reduction using OpenMP to realize dot-product 6

7 Example: Let s do reduction using OpenMP to realize dot-product 7

8 Example: Let s do reduction using OpenMP to realize dot-product 8

9 Example: Let s do reduction using OpenMP to realize dot-product 10 tests agree;; let s ship it! 9

10 Example: Let s do reduction using OpenMP to realize dot-product Wait, what s going on?! (3 tests bombed) 10

11 Example: Let s do reduction using OpenMP to realize dot-product (whom to blame?) 11

12 Example: Let s do reduction using OpenMP to realize dot-product + + Aha! + c a + a b b c 12

13 Kahan on Floating-point (Quote obtained from PhD dissertation of Eva Darulova) 13

14 FP behavior can be very non-intuitive! Often, we have a+(b+c) = (a+b)+c 14

15 FP harbors many surprises x is more accurate than log(e x ) but (e x 1) / x can be less accurate than (e x 1) / log(e x ) 15

16 FP harbors many surprises x is more accurate than log(e x ) but (e x 1) / x can be less accurate than (e x 1) / log(e x ) Don t blame the IEEE standard for this J 16

17 Floating-point numbers are ubiquitous! Financial software Embedded controllers Computer graphics Scientific simulation software Air-traffic trajectory definition Machining of prosthetic devices (e.g. hip replacement) Imprecise floating-point results can be really bad!! acement-surgery/multimedia/vid

18 Examples of recent FP errors Simulation in the Large Hadron Collider Need to track charged particles with exquisite precision 10 microns over 10 meters Round-off resulted in missed / mis-identified collisions (cf. Bailey and Borwein) Intel issues specification update for trig library Originally guaranteed to have a one ULP error Measured error was 164-billion ULPs 37 bits of the mantissa were wrong 18

19 A recent rounding-related bug 19

20 A recent rounding-related bug 20

21 Floating-point error analysis Important for FP library designers Even small errors can send simulations astray Important for FP hardware designers Remember the Pentium FDIV bug 21

22 Why only estimate FP error? Answer: Floating-point numbers are unevenly distributed IEEE Std. requires half ULP error for standard operators But, half ULP can be anywhere from to From Goualard,..Midpoint of an interval.. half ULP is this much here..and this much here 22

23 FP : Elephant in a bottle J 23

24 Of course, we can plot and see with a few lines of Racket code (N. Toronto) 24

25 Error Plot for Multiplication Absolute Error for Multiplication Y values X values 25

26 Error Plot for Addition Absolute Error for Addition Y values X values 26

27 Testing is inconclusive Low coverage Missed corner cases No rigorous guarantees 27

28 Formal verification methods are essential for obtaining rigorous floating-point error bounds! 28

29 Why tighter round-off error bounding? Avoids un-necessary verification failure Helps detect important corner-cases Avoids over-compensation With tighter FP error prediction, arithmetic library designers don t need to execute un-necessary compensation steps (Courtesy, conversation with John Harrison, Intel) 29

30 Problems with today s tools Often give pessimistic bounds Time-out Do not handle non-linear operators well Do not handle transcendental functions Exp, Log, Sin, Cos, Some tools support polynomial approximations;; we analyze them without such approximations 30

31 Our contribution: Symbolic Taylor Forms Handles non-linear and transcendental functions Tight error upper bounds Rigorous: Emits a HOL-Lite proof certificate Verification of the certificate guarantees estimate Tool + extended paper : Name of the tool : FPTaylor 31

32 Flow of FPTaylor Given FP Expression and Bounds Obtain Symbolic Taylor Form Obtain Error Function Maximize the Error Function Generate Certificate in HOL-Lite 32

33 Some basics of floating-point s m 22 m 0 e 7 e 0 We consider single-precision for most of our illustrations 33

34 Some basics of floating-point s m 22 m 0 e 7 e 0 Normal numbers : +/ to

35 Some basics of floating-point s m 22 m 0 e 7 e 0 Normal numbers : +/ to Subnormal numbers : +/

36 Some basics of floating-point s m 22 m 0 e 7 e 0 Normal numbers : +/ to Subnormal numbers : +/ While tiny, subnormals do matter! 36

37 FPTaylor is based on the standard IEEE Rounding Model Consider op(x, y) where x and y are floating-point values, and op is a function from floats to reals 37

38 FPTaylor is based on the standard IEEE Rounding Model Consider op(x, y) where x and y are floating-point values, and op is a function from floats to reals IEEE round-off errors are bounded by op(x, y) e op + d op 38

39 FPTaylor is based on the standard IEEE Rounding Model Consider op(x, y) where x and y are floating-point values, and op is a function from floats to reals IEEE round-off errors are bounded by op(x, y) e op + d op For normal values 39

40 FPTaylor is based on the standard IEEE Rounding Model Consider op(x, y) where x and y are floating-point values, and op is a function from floats to reals IEEE round-off errors are bounded by op(x, y) e op + d op For normal values For subnormal values 40

41 FPTaylor is based on the standard IEEE Rounding Model Consider op(x, y) where x and y are floating-point values, and op is a function from floats to reals IEEE round-off errors are bounded by op(x, y) e op + d op For normal values For subnormal values Only one of e op or d op is non-zero 41

42 FPTaylor is based on the standard IEEE Rounding Model Consider op(x, y) where x and y are floating-point values, and op is a function from floats to reals IEEE round-off errors are bounded by op(x, y) e op + d op For normal values For subnormal values Only one of e op or d op is non-zero e op 2 24 d op

43 Example of round-off error modeling (ignoring subnormals) Consider x/(x + y) 43

44 Example of round-off error modeling (ignoring subnormals) Consider x/(x + y) Round-off errors are incurred at both operations 44

45 Example of round-off error modeling (ignoring subnormals) Consider x/(x + y) Round-off errors are incurred at both operations (x + y) Error in bounded by (x + y) e+ 45

46 Example of round-off error modeling (ignoring subnormals on this slide) Consider x/(x + y) Round-off errors are incurred at both operations Error in Error in (x + y) x/(x + y) bounded by bounded by (x + y) e + (x/(x + y)) e / 46

47 Modeling max. round-off estimation Given the task of analyzing x/(x + y) 47

48 Modeling max. round-off estimation Given the task of analyzing x/(x + y) Model it as f(x, y) =x/(x + y) 48

49 Modeling max. round-off estimation Given the task of analyzing x/(x + y) Model it as f(x, y) =x/(x + y) Capturing round-off : f(x, y, e 1,e 2,d 1,d 2 )= (x/((x + y).(1 + e 1 )+d 1 )).(1 + e 2 )+d 2 49

50 Modeling max. round-off estimation Given the task of analyzing x/(x + y) Model it as f(x, y) =x/(x + y) Capturing round-off : f(x, y, e 1,e 2,d 1,d 2 )= (x/((x + y).(1 + e 1 )+d 1 )).(1 + e 2 )+d 2 Note that: f(x, y, 0, 0, 0, 0) = f(x, y) 50

51 Modeling max. round-off estimation Max round-off error in x/(x + y) 51

52 Modeling max. round-off estimation Max round-off error in x/(x + y) can be written as 52

53 Modeling max. round-off estimation Max round-off error in x/(x + y) can be written as Max over x, y, e 1,e 2,d 1,d 2 : f(x, y, e 1,e 2,d 1,d 2 ) f(x, y) 53

54 Unfortunately, this makes an already exponential problem worse Max over x, y, e 1,e 2,d 1,d 2 : f(x, y, e 1,e 2,d 1,d 2 ) f(x, y) We have to find the max of this function over Input variables Two additional variables per operator Curse of Dimensionality 54

55 Illustration of Curse of Dimensionality To analyze this example 55

56 Illustration of Curse of Dimensionality Optimization needs to run over 60 variables!! 56

57 Illustration of Curse of Dimensionality Optimization needs to run over 60 variables!! Two problem variables (x1 and x2) 58 noise variables (two per operator) 57

58 Illustration of Curse of Dimensionality Optimization needs to run over 60 variables!! Two problem variables (x1 and x2) 58 noise variables (two per operator) 58

59 Another problem with existing tools: Exaggerated error bounds 59

60 Another problem with existing tools: Exaggerated error bounds Consider something as simple as this: 60

61 Another problem with existing tools: Exaggerated error bounds Consider something as simple as this: 61

62 Another problem with existing tools: Exaggerated error bounds Consider something as simple as this: 62

63 Reason for problem: no correlation of variable values across sub-expressions 63

64 Reason for problem: no correlation of variable values across sub-expressions Say, we use interval arithmetic 64

65 Reason for problem: no correlation of variable values across sub-expressions Pick 999 for denominator x 65

66 Reason for problem: no correlation of variable values across sub-expressions Now switch things around (i.e. no correlation!!) 66

67 Symbolic Taylor Forms helps with both these problems Helps reduce dimensionality Helps reflect magnitudes of sub-expressions and also correlation of their values 67

68 What are Symbolic Taylor Forms? Basic idea : Treat each e and d as noise (error) variables Now expand (Taylor s theorem) Coefficients are Symbolic Coefficients weigh the noise correctly And are correlated Idealized Function First-order Error Estimated Second Order Error 68

69 Illustration of Symbolic Taylor Forms Example : 69

70 Illustration of Symbolic Taylor Forms Example : 70

71 Illustration of Symbolic Taylor Forms Example : 71

72 Illustration of Symbolic Taylor Forms Example : This is in Symbolic Taylor Form, i.e. FPTaylor generates this form very fast, using canned rules that are rigorous 72

73 Illustration of Symbolic Taylor Forms Example : Pristine (original) expression 73

74 Illustration of Symbolic Taylor Forms Example : Pristine (original) expression First Taylor (partial) derivatives w.r.t. e 1 and e 2 74

75 Illustration of Symbolic Taylor Forms Example : Pristine (original) expression First Taylor (partial) derivatives w.r.t. e 1 and e 2 All second (partial) derivatives w.r.t. e1 and e2 are here (plus the sub-normal error terms). 75

76 Illustration of Symbolic Taylor Forms Example : Round-off Error Estimate 76

77 Illustration of Symbolic Taylor Forms Example : Round-off Error Estimate Our global optimizer finds the max. of this function 77

78 FPTaylor Approach on jetengine After obtaining the Taylor forms We optimize just over TWO variables!! Not 60 variables!! 78

79 This is the payoff moment : Obtaining these rigorously verified error plots 79

80 FPTaylor result on jetengine Simpler optimization 80

81 FPTaylor result on jetengine Simpler optimization 81

82 Cool novelty of FPTaylor Based on rigorous global optimization Results are formally verified (so, fear not!) Can be parallelized! We are doing this now In a new tool called Gelpia FPTaylor release has a 100-line Ocaml global optimizer Still we are able to beat most existing tools, while offering better precision estimates 82

83 Symbolic Taylor Forms handle all functions (even Transcendental) the same Example : 83

84 Symbolic Taylor Forms handle all functions (even Transcendental) the same Example : This whole derivation works even if + is replaced by exp and / by log (say) 84

85 Symbolic Taylor Forms handle all functions (even Transcendental) the same Example : This whole derivation works even if + is replaced by exp and / by log (say) Symbolic Taylor Form derivation passes all the operators unopened to the Global Optimizer Global Optimizers can deal with many dirty functions (e.g. sin, exp, log ) rigorously 85

86 FPTaylor Results 86

87 FPTaylor Results 87

88 Non-monotonicity of accuracy 88

89 Non-monotonicity of accuracy 89

90 FPTaylor Results 90

91 Concluding Remarks We propose a new method for rigorous floating-point round-off error estimation Our method is embodied in new tool FPTaylor FPTaylor performs well (despite prototype global optimizer) and returns tighter bounds Bounds are within 2x of true errors Computed by running against MPFR 91

92 Future Work Faster global optimizer More benchmarks analyzed using above Characterization of libraries Potential uses : In reasoning tools (e.g., alongside Gappa) Say, in Frama-C or SMACK Ideal for designers of new FP libraries 92

93 Related Efforts Interval arithmetic Affine arithmetic SMT-based analysis Testing 93

94 Big Picture Floating-point has been the (nearly) centuryold approximate computing method People are going to skimp on precision even more Why move around all those dead bits Your software chain may throw surprises at any stage users beware! Invest in rigorous floating-point methods all along! 94

95 Extras 95

96 Example of Problem with Existing Tools 96

97 Example of Problem with Existing Tools 97

98 Example of Problem with Existing Tools But then change the settings for x in an un-correlated manner when calculating the overall error! (See the paper for details.) 98

99 Possible first principles Approach Start with the high level problem statement 99

100 Possible first principles Approach Start with the high level problem statement 100

101 Possible first principles Approach We can model the error in each operator as follows: Rounding Idealized (real number) operator 101

102 Possible first principles Approach We can model the error in each operator as follows: Rounding Idealized (real number) operator Mathematically proven identity for rounding 102

103 Possible first principles Approach Thus, lift the function to be analyzed as follows where given function additional parameters 103

104 Problem with such a direct approach Yikes! This max problem now has two extra variables per operator!! given function additional parameters 104

105 Direct Approach Results in Complex Global Optimization Problem Curse of dimensionality! With higher dimensionality, the exponential problem becomes IMPOSSIBLY HARD Key feature of our approach We drastically reduce dimensionality through the construction of Symbolic Taylor Forms Symbolic Taylor Forms serve two roles: By obtaining them, we reduce dimensionality They also help measure error proportional to magnitude of the FP expressions FPTaylor produces the maximum Absolute Error and Relative Error estimates on chosen input intervals 105

106 We avoid Curse of Dimensionality thru Symbolic Taylor Forms Basic idea : Treat each e and d as noise variables Expand given expression using Taylor s theorem Coefficients end up being Symbolic Self-adjust (to reflect magnitudes) As well as Correlate!! Idealized Function First-order Error Estimated Second Order Error 106

ANALYSIS AND SYNTHESIS OF FLOATING-POINT ROUTINES. Zvonimir Rakamarić

ANALYSIS AND SYNTHESIS OF FLOATING-POINT ROUTINES. Zvonimir Rakamarić ANALYSIS AND SYNTHESIS OF FLOATING-POINT ROUTINES Zvonimir Rakamarić ROADMAP 1. Introduction 2. Floating-point Research at Utah 3. Floating-points in SMACK Verifier 4. Floating-point Error Analysis 5.

More information

Reproducibility BoF Position, Solutions

Reproducibility BoF Position, Solutions Reproducibility BoF Position, Solutions Triaging Races, Floating Point, Other Concerns Wei-Fan Chiang, Ganesh Gopalakrishnan, Geof Sawaya, Simone Atzeni School of Computing, University of Utah, Salt Lake

More information

Efficient Search for Inputs Causing High Floating-point Errors

Efficient Search for Inputs Causing High Floating-point Errors Efficient Search for Inputs Causing High Floating-point Errors Wei-Fan Chiang, Ganesh Gopalakrishnan, Zvonimir Rakamarić, and Alexey Solovyev School of Computing, University of Utah, Salt Lake City, UT

More information

Efficient Search for Inputs Causing High Floating-point Errors

Efficient Search for Inputs Causing High Floating-point Errors Efficient Search for Inputs Causing High Floating-point Errors Wei-Fan Chiang, Ganesh Gopalakrishnan, Zvonimir Rakamarić, and Alexey Solovyev University of Utah Presented by Yuting Chen February 22, 2015

More information

Rigorous Estimation of Floating-Point Round-off Errors with Symbolic Taylor Expansions

Rigorous Estimation of Floating-Point Round-off Errors with Symbolic Taylor Expansions 0 Rigorous Estimation of Floating-Point Round-off Errors with Symbolic Taylor Expansions Alexey Solovyev, Marek S. Baranowski, Ian Briggs, Charles Jacobsen, Zvonimir Rakamarić, Ganesh Gopalakrishnan, School

More information

Automated Precision Tuning using Semidefinite Programming

Automated Precision Tuning using Semidefinite Programming Automated Precision Tuning using Semidefinite Programming Victor Magron, RA Imperial College joint work with G. Constantinides and A. Donaldson British-French-German Conference on Optimization 15 June

More information

A Parameterized Floating-Point Formalizaton in HOL Light

A Parameterized Floating-Point Formalizaton in HOL Light NSV 2015 A Parameterized Floating-Point Formalizaton in HOL Light Charles Jacobsen a,1,2 Alexey Solovyev a,3,5 Ganesh Gopalakrishnan a,4,5 a School of Computing University of Utah Salt Lake City, USA Abstract

More information

Enclosures of Roundoff Errors using SDP

Enclosures of Roundoff Errors using SDP Enclosures of Roundoff Errors using SDP Victor Magron, CNRS Jointly Certified Upper Bounds with G. Constantinides and A. Donaldson Metalibm workshop: Elementary functions, digital filters and beyond 12-13

More information

Certification of Roundoff Errors with SDP Relaxations and Formal Interval Methods

Certification of Roundoff Errors with SDP Relaxations and Formal Interval Methods Certification of Roundoff Errors with SDP Relaxations and Formal Interval Methods Victor Magron, CNRS VERIMAG Jointly Certified Upper Bounds with G. Constantinides and A. Donaldson Jointly Certified Lower

More information

Formal Verification in Industry

Formal Verification in Industry Formal Verification in Industry 1 Formal Verification in Industry John Harrison Intel Corporation The cost of bugs Formal verification Machine-checked proof Automatic and interactive approaches HOL Light

More information

Scientific Computing. Error Analysis

Scientific Computing. Error Analysis ECE257 Numerical Methods and Scientific Computing Error Analysis Today s s class: Introduction to error analysis Approximations Round-Off Errors Introduction Error is the difference between the exact solution

More information

Bindel, Fall 2016 Matrix Computations (CS 6210) Notes for

Bindel, Fall 2016 Matrix Computations (CS 6210) Notes for 1 Logistics Notes for 2016-09-07 1. We are still at 50. If you are still waiting and are not interested in knowing if a slot frees up, let me know. 2. There is a correction to HW 1, problem 4; the condition

More information

EE 109 Unit 19. IEEE 754 Floating Point Representation Floating Point Arithmetic

EE 109 Unit 19. IEEE 754 Floating Point Representation Floating Point Arithmetic 1 EE 109 Unit 19 IEEE 754 Floating Point Representation Floating Point Arithmetic 2 Floating Point Used to represent very small numbers (fractions) and very large numbers Avogadro s Number: +6.0247 * 10

More information

Numerical computing. How computers store real numbers and the problems that result

Numerical computing. How computers store real numbers and the problems that result Numerical computing How computers store real numbers and the problems that result The scientific method Theory: Mathematical equations provide a description or model Experiment Inference from data Test

More information

Classes of Real Numbers 1/2. The Real Line

Classes of Real Numbers 1/2. The Real Line Classes of Real Numbers All real numbers can be represented by a line: 1/2 π 1 0 1 2 3 4 real numbers The Real Line { integers rational numbers non-integral fractions irrational numbers Rational numbers

More information

Floating Point Considerations

Floating Point Considerations Chapter 6 Floating Point Considerations In the early days of computing, floating point arithmetic capability was found only in mainframes and supercomputers. Although many microprocessors designed in the

More information

Floating-Point Numbers in Digital Computers

Floating-Point Numbers in Digital Computers POLYTECHNIC UNIVERSITY Department of Computer and Information Science Floating-Point Numbers in Digital Computers K. Ming Leung Abstract: We explain how floating-point numbers are represented and stored

More information

Floating-Point Numbers in Digital Computers

Floating-Point Numbers in Digital Computers POLYTECHNIC UNIVERSITY Department of Computer and Information Science Floating-Point Numbers in Digital Computers K. Ming Leung Abstract: We explain how floating-point numbers are represented and stored

More information

The Design and Implementation of a Rigorous. A Rigorous High Precision Floating Point Arithmetic. for Taylor Models

The Design and Implementation of a Rigorous. A Rigorous High Precision Floating Point Arithmetic. for Taylor Models The and of a Rigorous High Precision Floating Point Arithmetic for Taylor Models Department of Physics, Michigan State University East Lansing, MI, 48824 4th International Workshop on Taylor Methods Boca

More information

Formal Verification of a Floating-Point Elementary Function

Formal Verification of a Floating-Point Elementary Function Introduction Coq & Flocq Coq.Interval Gappa Conclusion Formal Verification of a Floating-Point Elementary Function Inria Saclay Île-de-France & LRI, Université Paris Sud, CNRS 2015-06-25 Introduction Coq

More information

Introduction to Computer Programming with MATLAB Calculation and Programming Errors. Selis Önel, PhD

Introduction to Computer Programming with MATLAB Calculation and Programming Errors. Selis Önel, PhD Introduction to Computer Programming with MATLAB Calculation and Programming Errors Selis Önel, PhD Today you will learn Numbers, Significant figures Error analysis Absolute error Relative error Chopping

More information

(Refer Slide Time: 02:59)

(Refer Slide Time: 02:59) Numerical Methods and Programming P. B. Sunil Kumar Department of Physics Indian Institute of Technology, Madras Lecture - 7 Error propagation and stability Last class we discussed about the representation

More information

Floating-point Precision vs Performance Trade-offs

Floating-point Precision vs Performance Trade-offs Floating-point Precision vs Performance Trade-offs Wei-Fan Chiang School of Computing, University of Utah 1/31 Problem Statement Accelerating computations using graphical processing units has made significant

More information

How to Compute the Area of a Triangle: a Formal Revisit

How to Compute the Area of a Triangle: a Formal Revisit 21st IEEE International Symposium on Computer Arithmetic How to Compute the Area of a Triangle: a Formal Revisit Sylvie Boldo Inria Saclay Île-de-France, LRI, Université Paris-Sud April 9th, 2013 Motivations

More information

Floating Point Arithmetic

Floating Point Arithmetic Floating Point Arithmetic CS 365 Floating-Point What can be represented in N bits? Unsigned 0 to 2 N 2s Complement -2 N-1 to 2 N-1-1 But, what about? very large numbers? 9,349,398,989,787,762,244,859,087,678

More information

Floating-Point Arithmetic

Floating-Point Arithmetic Floating-Point Arithmetic Raymond J. Spiteri Lecture Notes for CMPT 898: Numerical Software University of Saskatchewan January 9, 2013 Objectives Floating-point numbers Floating-point arithmetic Analysis

More information

Formal verification of floating-point arithmetic at Intel

Formal verification of floating-point arithmetic at Intel 1 Formal verification of floating-point arithmetic at Intel John Harrison Intel Corporation 6 June 2012 2 Summary Some notable computer arithmetic failures 2 Summary Some notable computer arithmetic failures

More information

Mathematical Modeling to Formally Prove Correctness

Mathematical Modeling to Formally Prove Correctness 0 Mathematical Modeling to Formally Prove Correctness John Harrison Intel Corporation Gelato Meeting April 24, 2006 1 The human cost of bugs Computers are often used in safety-critical systems where a

More information

Computational Mathematics: Models, Methods and Analysis. Zhilin Li

Computational Mathematics: Models, Methods and Analysis. Zhilin Li Computational Mathematics: Models, Methods and Analysis Zhilin Li Chapter 1 Introduction Why is this course important (motivations)? What is the role of this class in the problem solving process using

More information

Numerical Precision. Or, why my numbers aren t numbering right. 1 of 15

Numerical Precision. Or, why my numbers aren t numbering right. 1 of 15 Numerical Precision Or, why my numbers aren t numbering right 1 of 15 What s the deal? Maybe you ve seen this #include int main() { float val = 3.6f; printf( %.20f \n, val); Print a float with

More information

Formal Verification of Floating-Point programs

Formal Verification of Floating-Point programs Formal Verification of Floating-Point programs Sylvie Boldo and Jean-Christophe Filliâtre Montpellier June, 26th 2007 INRIA Futurs CNRS, LRI Motivations Goal: reliability in numerical software Motivations

More information

Exact real arithmetic. Keith Briggs

Exact real arithmetic. Keith Briggs Exact real arithmetic Keith Briggs Keith.Briggs@bt.com more.btexact.com/people/briggsk2/xr.html 2002 Nov 20 15:00 Typeset in L A T E X2e on a linux system Exact real arithmetic p.1/35 Complexity Outline

More information

ESE532: System-on-a-Chip Architecture. Today. Message. Fixed Point. Operator Sizes. Observe. Fixed Point

ESE532: System-on-a-Chip Architecture. Today. Message. Fixed Point. Operator Sizes. Observe. Fixed Point ESE532: System-on-a-Chip Architecture Day 27: December 5, 2018 Representation and Precision Fixed Point Today Errors from Limited Precision Precision Analysis / Interval Arithmetic Floating Point If time

More information

Combining Tools for Optimization and Analysis of Floating-Point Computations

Combining Tools for Optimization and Analysis of Floating-Point Computations Combining Tools for Optimization and Analysis of Floating-Point Computations Heiko Becker 1, Pavel Panchekha 2, Eva Darulova 1, and Zachary Tatlock 2 1 MPI-SWS {hbecker,eva}@mpi-sws.org 2 University of

More information

(Refer Slide Time 3:31)

(Refer Slide Time 3:31) Digital Circuits and Systems Prof. S. Srinivasan Department of Electrical Engineering Indian Institute of Technology Madras Lecture - 5 Logic Simplification In the last lecture we talked about logic functions

More information

FP-ANR: Another representation format to handle cancellation at run-time. David Defour LAMPS, Univ. de Perpignan (France)

FP-ANR: Another representation format to handle cancellation at run-time. David Defour LAMPS, Univ. de Perpignan (France) FP-ANR: Another representation format to handle cancellation at run-time David Defour LAMPS, Univ. de Perpignan (France) Motivations Number s representation really matters List of problems Uncertainty

More information

What Every Programmer Should Know About Floating-Point Arithmetic

What Every Programmer Should Know About Floating-Point Arithmetic What Every Programmer Should Know About Floating-Point Arithmetic Last updated: October 15, 2015 Contents 1 Why don t my numbers add up? 3 2 Basic Answers 3 2.1 Why don t my numbers, like 0.1 + 0.2 add

More information

Chapter 5 Hashing. Introduction. Hashing. Hashing Functions. hashing performs basic operations, such as insertion,

Chapter 5 Hashing. Introduction. Hashing. Hashing Functions. hashing performs basic operations, such as insertion, Introduction Chapter 5 Hashing hashing performs basic operations, such as insertion, deletion, and finds in average time 2 Hashing a hash table is merely an of some fixed size hashing converts into locations

More information

Table : IEEE Single Format ± a a 2 a 3 :::a 8 b b 2 b 3 :::b 23 If exponent bitstring a :::a 8 is Then numerical value represented is ( ) 2 = (

Table : IEEE Single Format ± a a 2 a 3 :::a 8 b b 2 b 3 :::b 23 If exponent bitstring a :::a 8 is Then numerical value represented is ( ) 2 = ( Floating Point Numbers in Java by Michael L. Overton Virtually all modern computers follow the IEEE 2 floating point standard in their representation of floating point numbers. The Java programming language

More information

unused unused unused unused unused unused

unused unused unused unused unused unused BCD numbers. In some applications, such as in the financial industry, the errors that can creep in due to converting numbers back and forth between decimal and binary is unacceptable. For these applications

More information

function at the given point. Thus, for our previous example we would find that lim f(x) = 0

function at the given point. Thus, for our previous example we would find that lim f(x) = 0 Limits In order to introduce the notion of the it, we will consider the following situation. Suppose you are given a function, defined on some interval, except at a single point in the interval. What,

More information

LECTURE 0: Introduction and Background

LECTURE 0: Introduction and Background 1 LECTURE 0: Introduction and Background September 10, 2012 1 Computational science The role of computational science has become increasingly significant during the last few decades. It has become the

More information

8 Towards a Compiler for Reals 1

8 Towards a Compiler for Reals 1 8 Towards a Compiler for Reals 1 EVA DARULOVA 2, Max Planck Institute for Software Systems VIKTOR KUNCAK 3, Ecole Polytechnique Federale de Lausanne Numerical software, common in scientific computing or

More information

The Perils of Floating Point

The Perils of Floating Point The Perils of Floating Point by Bruce M. Bush Copyright (c) 1996 Lahey Computer Systems, Inc. Permission to copy is granted with acknowledgement of the source. Many great engineering and scientific advances

More information

Software Verification of Safety-Critical Aerospace Systems1

Software Verification of Safety-Critical Aerospace Systems1 Software Verification of Safety-Critical Aerospace Systems1 Ce sar A. Mun oz Alwyn Goodloe {cesar.a.munoz,a.goodloe}@nasa.gov Frama-C Day 2016 June 20th, 2016 1 This presentation reports joint work with

More information

CODE ANALYSES FOR NUMERICAL ACCURACY WITH AFFINE FORMS: FROM DIAGNOSIS TO THE ORIGIN OF THE NUMERICAL ERRORS. Teratec 2017 Forum Védrine Franck

CODE ANALYSES FOR NUMERICAL ACCURACY WITH AFFINE FORMS: FROM DIAGNOSIS TO THE ORIGIN OF THE NUMERICAL ERRORS. Teratec 2017 Forum Védrine Franck CODE ANALYSES FOR NUMERICAL ACCURACY WITH AFFINE FORMS: FROM DIAGNOSIS TO THE ORIGIN OF THE NUMERICAL ERRORS NUMERICAL CODE ACCURACY WITH FLUCTUAT Compare floating point with ideal computation Use interval

More information

CS321 Introduction To Numerical Methods

CS321 Introduction To Numerical Methods CS3 Introduction To Numerical Methods Fuhua (Frank) Cheng Department of Computer Science University of Kentucky Lexington KY 456-46 - - Table of Contents Errors and Number Representations 3 Error Types

More information

Truncation Errors. Applied Numerical Methods with MATLAB for Engineers and Scientists, 2nd ed., Steven C. Chapra, McGraw Hill, 2008, Ch. 4.

Truncation Errors. Applied Numerical Methods with MATLAB for Engineers and Scientists, 2nd ed., Steven C. Chapra, McGraw Hill, 2008, Ch. 4. Chapter 4: Roundoff and Truncation Errors Applied Numerical Methods with MATLAB for Engineers and Scientists, 2nd ed., Steven C. Chapra, McGraw Hill, 2008, Ch. 4. 1 Outline Errors Accuracy and Precision

More information

Efficient Search for Inputs Causing High Floating-point Errors

Efficient Search for Inputs Causing High Floating-point Errors Efficient Search for Inputs Causing High Floating-point Errors Wei-Fan Chiang Ganesh Gopalakrishnan Zvonimir Rakamarić Alexey Solovyev School of Computing, University of Utah, Salt Lake City, UT 84112,

More information

Review of Calculus, cont d

Review of Calculus, cont d Jim Lambers MAT 460/560 Fall Semester 2009-10 Lecture 4 Notes These notes correspond to Sections 1.1 1.2 in the text. Review of Calculus, cont d Taylor s Theorem, cont d We conclude our discussion of Taylor

More information

Learning from Math Library Testng for C Marcel Beemster Solid Sands

Learning from Math Library Testng for C Marcel Beemster Solid Sands Learning from Math Library Testng for C Marcel Beemster Solid Sands Introduction In the process of improving SuperTest, I recently dived into its math library testing. Turns out there were some interesting

More information

Exponential Numbers ID1050 Quantitative & Qualitative Reasoning

Exponential Numbers ID1050 Quantitative & Qualitative Reasoning Exponential Numbers ID1050 Quantitative & Qualitative Reasoning In what ways can you have $2000? Just like fractions, you can have a number in some denomination Number Denomination Mantissa Power of 10

More information

Introduction. hashing performs basic operations, such as insertion, better than other ADTs we ve seen so far

Introduction. hashing performs basic operations, such as insertion, better than other ADTs we ve seen so far Chapter 5 Hashing 2 Introduction hashing performs basic operations, such as insertion, deletion, and finds in average time better than other ADTs we ve seen so far 3 Hashing a hash table is merely an hashing

More information

Towards an industrial use of FLUCTUAT on safety-critical avionics software

Towards an industrial use of FLUCTUAT on safety-critical avionics software Towards an industrial use of FLUCTUAT on safety-critical avionics software David Delmas 1, Eric Goubault 2, Sylvie Putot 2, Jean Souyris 1, Karim Tekkal 3 and Franck Védrine 2 1. Airbus Operations S.A.S.,

More information

IEEE Floating Point Numbers Overview

IEEE Floating Point Numbers Overview COMP 40: Machine Structure and Assembly Language Programming (Fall 2015) IEEE Floating Point Numbers Overview Noah Mendelsohn Tufts University Email: noah@cs.tufts.edu Web: http://www.cs.tufts.edu/~noah

More information

MAT128A: Numerical Analysis Lecture Two: Finite Precision Arithmetic

MAT128A: Numerical Analysis Lecture Two: Finite Precision Arithmetic MAT128A: Numerical Analysis Lecture Two: Finite Precision Arithmetic September 28, 2018 Lecture 1 September 28, 2018 1 / 25 Floating point arithmetic Computers use finite strings of binary digits to represent

More information

Numerical Computations and Formal Methods

Numerical Computations and Formal Methods Program verification Formal arithmetic Decision procedures Proval, Laboratoire de Recherche en Informatique INRIA Saclay IdF, Université Paris Sud, CNRS October 28, 2009 Program verification Formal arithmetic

More information

Some issues related to double roundings

Some issues related to double roundings Some issues related to double roundings Erik Martin-Dorel 1 Guillaume Melquiond 2 Jean-Michel Muller 3 1 ENS Lyon, 2 Inria, 3 CNRS Valencia, June 2012 Martin-Dorel, Melquiond, Muller Some issues related

More information

Generating formally certified bounds on values and round-off errors

Generating formally certified bounds on values and round-off errors Generating formally certified bounds on values and round-off errors Marc DAUMAS and Guillaume MELQUIOND LIP Computer Science Laboratory UMR 5668 CNRS ENS Lyon INRIA UCBL Lyon, France Generating formally

More information

AAL 217: DATA STRUCTURES

AAL 217: DATA STRUCTURES Chapter # 4: Hashing AAL 217: DATA STRUCTURES The implementation of hash tables is frequently called hashing. Hashing is a technique used for performing insertions, deletions, and finds in constant average

More information

SWORD: A Bounded Memory-Overhead Detector of OpenMP Data Races in Production Runs

SWORD: A Bounded Memory-Overhead Detector of OpenMP Data Races in Production Runs SWORD: A Bounded Memory-Overhead Detector of OpenMP Data Races in Production Runs Simone Atzeni, Ganesh Gopalakrishnan, Zvonimir Rakamaric School of Computing, University of Utah, Salt Lake City, UT 84112

More information

Simultaneous floating-point sine and cosine for VLIW integer processors

Simultaneous floating-point sine and cosine for VLIW integer processors Simultaneous floating-point sine and cosine for VLIW integer processors Jingyan Jourdan-Lu Computer Arithmetic group ARIC INRIA and ENS Lyon, France Compilation Expertise Center STMicroelectronics Grenoble,

More information

11.1 Facility Location

11.1 Facility Location CS787: Advanced Algorithms Scribe: Amanda Burton, Leah Kluegel Lecturer: Shuchi Chawla Topic: Facility Location ctd., Linear Programming Date: October 8, 2007 Today we conclude the discussion of local

More information

Using Arithmetic of Real Numbers to Explore Limits and Continuity

Using Arithmetic of Real Numbers to Explore Limits and Continuity Using Arithmetic of Real Numbers to Explore Limits and Continuity by Maria Terrell Cornell University Problem Let a =.898989... and b =.000000... (a) Find a + b. (b) Use your ideas about how to add a and

More information

Up next. Midterm. Today s lecture. To follow

Up next. Midterm. Today s lecture. To follow Up next Midterm Next Friday in class Exams page on web site has info + practice problems Excited for you to rock the exams like you have been the assignments! Today s lecture Back to numbers, bits, data

More information

10/5/2016. Comparing Algorithms. Analyzing Code ( worst case ) Example. Analyzing Code. Binary Search. Linear Search

10/5/2016. Comparing Algorithms. Analyzing Code ( worst case ) Example. Analyzing Code. Binary Search. Linear Search 10/5/2016 CSE373: Data Structures and Algorithms Asymptotic Analysis (Big O,, and ) Steve Tanimoto Autumn 2016 This lecture material represents the work of multiple instructors at the University of Washington.

More information

Binary floating point encodings

Binary floating point encodings Week 1: Wednesday, Jan 25 Binary floating point encodings Binary floating point arithmetic is essentially scientific notation. Where in decimal scientific notation we write in floating point, we write

More information

Make Computer Arithmetic Great Again?

Make Computer Arithmetic Great Again? Make Computer Arithmetic Great Again? Jean-Michel Muller CNRS, ENS Lyon, Inria, Université de Lyon France ARITH-25 June 2018 -2- An apparent contradiction low number of paper submissions to Arith these

More information

Efficient implementation of elementary functions in the medium-precision range

Efficient implementation of elementary functions in the medium-precision range Efficient implementation of elementary functions in the medium-precision range Fredrik Johansson (LFANT, INRIA Bordeaux) 22nd IEEE Symposium on Computer Arithmetic (ARITH 22), Lyon, France, June 2015 1

More information

LIMITATIONS OF COMPUTING. Introduction to Computer Engineering 2015 Spring by Euiseong Seo

LIMITATIONS OF COMPUTING. Introduction to Computer Engineering 2015 Spring by Euiseong Seo LIMITATIONS OF COMPUTING Introduction to Computer Engineering 2015 Spring by Euiseong Seo Where are we? Chapter 1: The Big Picture Chapter 2: Binary Values and Number Systems Chapter 3: Date Representation

More information

Representing numbers on the computer. Computer memory/processors consist of items that exist in one of two possible states (binary states).

Representing numbers on the computer. Computer memory/processors consist of items that exist in one of two possible states (binary states). Representing numbers on the computer. Computer memory/processors consist of items that exist in one of two possible states (binary states). These states are usually labeled 0 and 1. Each item in memory

More information

Assisted verification of elementary functions using Gappa

Assisted verification of elementary functions using Gappa Assisted verification of elementary functions using Gappa Florent de Dinechin Florent.de.Dinechin@ens-lyon.fr Christoph Quirin Lauter Christoph.Lauter@ens-lyon.fr Guillaume Melquiond Guillaume.Melquiond@ens-lyon.fr

More information

Numerical considerations

Numerical considerations Numerical considerations CHAPTER 6 CHAPTER OUTLINE 6.1 Floating-Point Data Representation...13 Normalized Representation of M...13 Excess Encoding of E...133 6. Representable Numbers...134 6.3 Special

More information

Logic Synthesis & Optimization Lectures 4, 5 Boolean Algebra - Basics

Logic Synthesis & Optimization Lectures 4, 5 Boolean Algebra - Basics Logic Synthesis & Optimization Lectures 4, 5 Boolean Algebra - Basics 1 Instructor: Priyank Kalla Department of Electrical and Computer Engineering University of Utah, Salt Lake City, UT 84112 Email: kalla@ece.utah.edu

More information

An FPGA Implementation of the Powering Function with Single Precision Floating-Point Arithmetic

An FPGA Implementation of the Powering Function with Single Precision Floating-Point Arithmetic An FPGA Implementation of the Powering Function with Single Precision Floating-Point Arithmetic Pedro Echeverría, Marisa López-Vallejo Department of Electronic Engineering, Universidad Politécnica de Madrid

More information

CS201: Computer Vision Introduction to Tracking

CS201: Computer Vision Introduction to Tracking CS201: Computer Vision Introduction to Tracking John Magee 18 November 2014 Slides courtesy of: Diane H. Theriault Question of the Day How can we represent and use motion in images? 1 What is Motion? Change

More information

General Idea. Key could be an integer, a string, etc e.g. a name or Id that is a part of a large employee structure

General Idea. Key could be an integer, a string, etc e.g. a name or Id that is a part of a large employee structure Hashing 1 Hash Tables We ll discuss the hash table ADT which supports only a subset of the operations allowed by binary search trees. The implementation of hash tables is called hashing. Hashing is a technique

More information

Recitation 4: Elimination algorithm, reconstituted graph, triangulation

Recitation 4: Elimination algorithm, reconstituted graph, triangulation Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science 6.438 Algorithms For Inference Fall 2014 Recitation 4: Elimination algorithm, reconstituted graph, triangulation

More information

Formal Certification of Arithmetic Filters for Geometric Predicates

Formal Certification of Arithmetic Filters for Geometric Predicates Introduction Formalization Implementation Conclusion Formal Certification of Arithmetic Filters for Geometric Predicates Guillaume Melquiond Sylvain Pion Arénaire, LIP ENS Lyon Geometrica, INRIA Sophia-Antipolis

More information

Long (or LONGMATH ) floating-point (or integer) variables (length up to 1 million, limited by machine memory, range: approx. ±10 1,000,000.

Long (or LONGMATH ) floating-point (or integer) variables (length up to 1 million, limited by machine memory, range: approx. ±10 1,000,000. QuickCalc User Guide. Number Representation, Assignment, and Conversion Variables Constants Usage Double (or DOUBLE ) floating-point variables (approx. 16 significant digits, range: approx. ±10 308 The

More information

GPU & Computer Arithmetics

GPU & Computer Arithmetics GPU & Computer Arithmetics David Defour University of Perpignan Key multicore challenges Performance challenge How to scale from 1 to 1000 cores The number of cores is the new MegaHertz Power efficiency

More information

Machine Computation of the Sine Function

Machine Computation of the Sine Function Machine Computation of the Sine Function Chuck Allison CNS 3320 Numerical Software Engineering Utah Valley State College February 2007 Abstract This note shows how to determine the number of terms to use

More information

Scientific Computing: An Introductory Survey

Scientific Computing: An Introductory Survey Scientific Computing: An Introductory Survey Chapter 1 Scientific Computing Prof. Michael T. Heath Department of Computer Science University of Illinois at Urbana-Champaign Copyright c 2002. Reproduction

More information

How Not to Measure Performance: Lessons from Parallel Computing or Only Make New Mistakes William Gropp

How Not to Measure Performance: Lessons from Parallel Computing or Only Make New Mistakes William Gropp How Not to Measure Performance: Lessons from Parallel Computing or Only Make New Mistakes William Gropp www.mcs.anl.gov/~gropp Why Measure Performance? Publish papers or sell product Engineer a solution

More information

x y

x y 10. LECTURE 10 Objectives I understand the difficulty in finding an appropriate function for a data set in general. In some cases, I can define a function type that may fit a data set well. Last time,

More information

How Hard Is Inference for Structured Prediction?

How Hard Is Inference for Structured Prediction? How Hard Is Inference for Structured Prediction? Tim Roughgarden (Stanford University) joint work with Amir Globerson (Tel Aviv), David Sontag (NYU), and Cafer Yildirum (NYU) 1 Structured Prediction structured

More information

HashTable CISC5835, Computer Algorithms CIS, Fordham Univ. Instructor: X. Zhang Fall 2018

HashTable CISC5835, Computer Algorithms CIS, Fordham Univ. Instructor: X. Zhang Fall 2018 HashTable CISC5835, Computer Algorithms CIS, Fordham Univ. Instructor: X. Zhang Fall 2018 Acknowledgement The set of slides have used materials from the following resources Slides for textbook by Dr. Y.

More information

Computing Integer Powers in Floating-Point Arithmetic

Computing Integer Powers in Floating-Point Arithmetic Computing Integer Powers in Floating-Point Arithmetic Peter Kornerup Vincent Lefèvre Jean-Michel Muller May 2007 This is LIP Research Report number RR2007-23 Ceci est le Rapport de Recherches numéro RR2007-23

More information

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Algorithms For Inference Fall 2014

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Algorithms For Inference Fall 2014 Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science 6.438 Algorithms For Inference Fall 2014 Recitation-6: Hardness of Inference Contents 1 NP-Hardness Part-II

More information

Computer Arithmetic. 1. Floating-point representation of numbers (scientific notation) has four components, for example, 3.

Computer Arithmetic. 1. Floating-point representation of numbers (scientific notation) has four components, for example, 3. ECS231 Handout Computer Arithmetic I: Floating-point numbers and representations 1. Floating-point representation of numbers (scientific notation) has four components, for example, 3.1416 10 1 sign significandbase

More information

CHAPTER 5: Representing Numerical Data

CHAPTER 5: Representing Numerical Data CHAPTER 5: Representing Numerical Data The Architecture of Computer Hardware and Systems Software & Networking: An Information Technology Approach 4th Edition, Irv Englander John Wiley and Sons 2010 PowerPoint

More information

Floating Point. EE 109 Unit 20. Floating Point Representation. Fixed Point

Floating Point. EE 109 Unit 20. Floating Point Representation. Fixed Point 2.1 Floating Point 2.2 EE 19 Unit 2 IEEE 754 Floating Point Representation Floating Point Arithmetic Used to represent very numbers (fractions) and very numbers Avogadro s Number: +6.247 * 1 23 Planck

More information

Divisibility Rules and Their Explanations

Divisibility Rules and Their Explanations Divisibility Rules and Their Explanations Increase Your Number Sense These divisibility rules apply to determining the divisibility of a positive integer (1, 2, 3, ) by another positive integer or 0 (although

More information

arxiv: v1 [cs.na] 3 Jan 2008

arxiv: v1 [cs.na] 3 Jan 2008 Certifying floating-point implementations using Gappa Florent de Dinechin, Christoph Lauter, and Guillaume Melquiond February 2, 2008 arxiv:0801.0523v1 [cs.na] 3 Jan 2008 Abstract High confidence in floating-point

More information

1. Fill in the right hand side of the following equation by taking the derivative: (x sin x) =

1. Fill in the right hand side of the following equation by taking the derivative: (x sin x) = 7.1 What is x cos x? 1. Fill in the right hand side of the following equation by taking the derivative: (x sin x = 2. Integrate both sides of the equation. Instructor: When instructing students to integrate

More information

CS321. Introduction to Numerical Methods

CS321. Introduction to Numerical Methods CS31 Introduction to Numerical Methods Lecture 1 Number Representations and Errors Professor Jun Zhang Department of Computer Science University of Kentucky Lexington, KY 40506 0633 August 5, 017 Number

More information

2.1.1 Fixed-Point (or Integer) Arithmetic

2.1.1 Fixed-Point (or Integer) Arithmetic x = approximation to true value x error = x x, relative error = x x. x 2.1.1 Fixed-Point (or Integer) Arithmetic A base 2 (base 10) fixed-point number has a fixed number of binary (decimal) places. 1.

More information

Floating Point. CSC207 Fall 2017

Floating Point. CSC207 Fall 2017 Floating Point CSC207 Fall 2017 Ariane 5 Rocket Launch Ariane 5 rocket explosion In 1996, the European Space Agency s Ariane 5 rocket exploded 40 seconds after launch. During conversion of a 64-bit to

More information

Proving Tight Bounds on Univariate Expressions with Elementary Functions in Coq

Proving Tight Bounds on Univariate Expressions with Elementary Functions in Coq Proving Tight Bounds on Univariate Expressions with Elementary Functions in Coq Érik Martin-Dorel http://www.irit.fr/~erik.martin-dorel/ Équipe ACADIE, Laboratoire IRIT Université Toulouse III - Paul Sabatier

More information

Design and Analysis of Algorithms Prof. Madhavan Mukund Chennai Mathematical Institute. Week 02 Module 06 Lecture - 14 Merge Sort: Analysis

Design and Analysis of Algorithms Prof. Madhavan Mukund Chennai Mathematical Institute. Week 02 Module 06 Lecture - 14 Merge Sort: Analysis Design and Analysis of Algorithms Prof. Madhavan Mukund Chennai Mathematical Institute Week 02 Module 06 Lecture - 14 Merge Sort: Analysis So, we have seen how to use a divide and conquer strategy, we

More information