Verification of Numerical Results, using Posits, Valids, and Quires

Similar documents
AM205: lecture 2. 1 These have been shifted to MD 323 for the rest of the semester.

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

High Speed Associative Accumulation of Floating-point Numbers and Floating-point Intervals

Errors in Computation

Roundoff Errors and Computer Arithmetic

High Speed Associative Accumulation of Floating-point Numbers and Floating-point Intervals

Computational Methods. Sources of Errors

Floating-Point Numbers in Digital Computers

EE878 Special Topics in VLSI. Computer Arithmetic for Digital Signal Processing

Computational Economics and Finance

UNIVERSITY OF MASSACHUSETTS Dept. of Electrical & Computer Engineering. Digital Computer Arithmetic ECE 666

Floating-Point Numbers in Digital Computers

Complete Interval Arithmetic and its Implementation on the Computer

Mathematical preliminaries and error analysis

CHAPTER 5: Representing Numerical Data

Computational Economics and Finance

2. Motivation and Introduction. Floating Point Numbers & Arithmetics

Reals 1. Floating-point numbers and their properties. Pitfalls of numeric computation. Horner's method. Bisection. Newton's method.

2 Computation with Floating-Point Numbers

What we need to know about error: Class Outline. Computational Methods CMSC/AMSC/MAPL 460. Errors in data and computation

CS321 Introduction To Numerical Methods

Floating-Point Arithmetic

Computational Methods CMSC/AMSC/MAPL 460. Representing numbers in floating point and associated issues. Ramani Duraiswami, Dept. of Computer Science

Computational Methods CMSC/AMSC/MAPL 460. Representing numbers in floating point and associated issues. Ramani Duraiswami, Dept. of Computer Science

A.1 Numbers, Sets and Arithmetic

Review Questions 26 CHAPTER 1. SCIENTIFIC COMPUTING

Divide: Paper & Pencil

DESIGN OF A COMPOSITE ARITHMETIC UNIT FOR RATIONAL NUMBERS

MAT128A: Numerical Analysis Lecture Two: Finite Precision Arithmetic

A Formally-Proved Algorithm to Compute the Correct Average of Decimal Floating-Point Numbers

Roundoff Noise in Scientific Computations

Place Value. Verbal Form: 30,542 = Thirty thousand, five hundred forty-two. (Notice we don t use the word and.)

2 Computation with Floating-Point Numbers

CHAPTER 2 SENSITIVITY OF LINEAR SYSTEMS; EFFECTS OF ROUNDOFF ERRORS

On Unbounded Tolerable Solution Sets

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

Scientific Computing. Error Analysis

SHAPE, SPACE & MEASURE

Computing Basics. 1 Sources of Error LECTURE NOTES ECO 613/614 FALL 2007 KAREN A. KOPECKY

GPU & Computer Arithmetics

DLD VIDYA SAGAR P. potharajuvidyasagar.wordpress.com. Vignana Bharathi Institute of Technology UNIT 1 DLD P VIDYA SAGAR

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

ROUNDING ERRORS LAB 1. OBJECTIVE 2. INTRODUCTION

Floating-point representation

COMPUTER ORGANIZATION AND ARCHITECTURE

Matthieu Lefebvre Princeton University. Monday, 10 July First Computational and Data Science school for HEP (CoDaS-HEP)

Floating Point Numbers

Floating Point Numbers

COMPUTER ORGANIZATION AND DESIGN. 5 th Edition. The Hardware/Software Interface. Chapter 3. Arithmetic for Computers Implementation

Review of Calculus, cont d

Floating Point Representation in Computers

UNIVERSITY OF MASSACHUSETTS Dept. of Electrical & Computer Engineering. Digital Computer Arithmetic ECE 666

Outline. L9: Project Discussion and Floating Point Issues. Project Parts (Total = 50%) Project Proposal (due 3/8) 2/13/12.

Computational Methods CMSC/AMSC/MAPL 460. Representing numbers in floating point Error Analysis. Ramani Duraiswami, Dept. of Computer Science

Most nonzero floating-point numbers are normalized. This means they can be expressed as. x = ±(1 + f) 2 e. 0 f < 1

Numerical considerations

CS321. Introduction to Numerical Methods

Scientific Computing: An Introductory Survey

Floating Point Considerations

CS 6210 Fall 2016 Bei Wang. Lecture 4 Floating Point Systems Continued

Equations and Problem Solving with Fractions. Variable. Expression. Equation. A variable is a letter used to represent a number.

Up-to-date Interval Arithmetic From Closed Intervals to Connected Sets of Real Numbers

Gateway Regional School District VERTICAL ALIGNMENT OF MATHEMATICS STANDARDS Grades 3-6

Computer Architecture and Organization

MAT 003 Brian Killough s Instructor Notes Saint Leo University

Numerical Linear Algebra

Numerical Methods 5633

4 Operations On Data 4.1. Foundations of Computer Science Cengage Learning

Formal verification of floating-point arithmetic at Intel

Data Representation Type of Data Representation Integers Bits Unsigned 2 s Comp Excess 7 Excess 8

The School District of Palm Beach County Fourth Grade Mathematics Scope st Trimester

Gurobi Guidelines for Numerical Issues February 2017

Arithmetic Logic Unit

Calculus I Review Handout 1.3 Introduction to Calculus - Limits. by Kevin M. Chevalier

Reliable Nonlinear Parameter Estimation Using Interval Analysis: Error-in-Variable Approach

Principles of Computer Architecture. Chapter 3: Arithmetic

Honors Precalculus: Solving equations and inequalities graphically and algebraically. Page 1

Computer Architecture and IC Design Lab. Chapter 3 Part 2 Arithmetic for Computers Floating Point

Part III The Arithmetic/Logic Unit. Oct Computer Architecture, The Arithmetic/Logic Unit Slide 1

Number and Operation Standard #1. Divide multi- digit numbers; solve real- world and mathematical problems using arithmetic.

Efficient floating point: software and hardware

By, Ajinkya Karande Adarsh Yoga

Year 8 Mathematics Curriculum Map

HOW TO DIVIDE: MCC6.NS.2 Fluently divide multi-digit numbers using the standard algorithm. WORD DEFINITION IN YOUR WORDS EXAMPLE

Computational Mathematics: Models, Methods and Analysis. Zhilin Li

Accuracy versus precision

Mark Important Points in Margin. Significant Figures. Determine which digits in a number are significant.

Foundations of Computer Systems

YEAR 11 GCSE MATHS REVISION CHECKLIST FOUNDATION TIER TOPICS ARE CATEGORISED VIA MATHS STRANDS NUMBER TOPICS

Representing and Manipulating Floating Points

Curriculum Area: Mathematics Year: 10 Foundation. Aspire Learn Achieve. 1 Number All students have access to:

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

5/27/12. Objectives 7.1. Area of a Region Between Two Curves. Find the area of a region between two curves using integration.

Finite arithmetic and error analysis

Floating Point Puzzles The course that gives CMU its Zip! Floating Point Jan 22, IEEE Floating Point. Fractional Binary Numbers.

Mathematics Scope & Sequence Grade 5 Revised: May 10, 2016

Chapter 03: Computer Arithmetic. Lesson 09: Arithmetic using floating point numbers

On JAM of Triangular Fuzzy Number Matrices

Read, write compare and order numbers beyond 1000 in numerals and words Read Roman numerals to 100 and understand how they have changed through time

Chapter 3. Errors and numerical stability

Transcription:

Verification of Numerical Results, using Posits, Valids, and Quires Gerd Bohlender, Karlsruhe Institute of Technology CoNGA Singapore, March 28, 2018

Outline Floating-Point Arithmetic Pure vs. Applied Mathematics, Problems Posits Interval Arithmetic, Valids Exact Dot Products, Quires Numerical Algorithms with Verified Results Conclusion March 28, 2018 Verification of Numerical Results using Posits, Valids and Quires 2

IEEE Floating-Point Arithmetic IEEE Standard 754, issued 1985, revised 2008 Widely adopted industry standard Easier interchange of data and programs Exception handling with NaNs etc. has advantages and disadvantages Results may differon different platforms Results of algorithms may be unreliable March 28, 2018 Verification of Numerical Results using Posits, Valids and Quires 3

Pure vs. Applied Mathematics Pure Mathematics: for all real numbers x, y, z the associative law (x+y)+z = x+(y+z) holds Applied Mathematics / Computed Results: x is an approximate solution of the given problem with an error estimation eps neglecting higher order terms and influence of rounding error Strong contrast between these concepts March 28, 2018 Verification of Numerical Results using Posits, Valids and Quires 4

Problems with Floating-Point Arithmetic Ex. 1: Evaluate p " 4 p & q & + q " for p = 665857, q = 470832 Result in double precision: 3.3554432 2 10 4 Correct result: 1 Ex. 2: Evaluate sum 10 &5 + 1 10 &5 Result in double precision: 0 Correct result: 1 Ex. 3: Linear system 2x2, solution requires 7 arithmetic operations All digits of result are wrong March 28, 2018 Verification of Numerical Results using Posits, Valids and Quires 5

Fractal, Influence of Arithmetic Identical fractal Identical number of steps Identical coloring scheme Different floatingpoint formats Which graph is better? March 28, 2018 Verification of Numerical Results using Posits, Valids and Quires 6

Problems with Floating-Point Arithmetic Supercomputers don t solve such trivial problems Tianhe-2 has 34 Petaflops what does this mean? Imagine: print all computed values (in small font on both sides of paper) Height of pile of paper for one second of calculations??? March 28, 2018 Verification of Numerical Results using Posits, Valids and Quires 7

Problems with Floating-Point Arithmetic Supercomputers don t solve such trivial problems Tianhe-2 has 34 Petaflops what does this mean? Imagine: print all computed values (in small font on both sides of paper) Height of pile of paper for one second of calculations??? 3.4 million kilometres = 9 x distance from earth to moon!!! How reliable are these results? Who can check them? Special tools on computer are needed! March 28, 2018 Verification of Numerical Results using Posits, Valids and Quires 8

Posits, a New Floating-Point Format Flexible trade-off between exponent bits (regime + exponent) and mantissa bits Higher accuracy than IEEE 754 for numbers close to 1 Special representation for ± No other special cases like NaN, gradual underflow Better results in typical applications [Gustafson, Yonemoto] However, results may still be unreliable March 28, 2018 Verification of Numerical Results using Posits, Valids and Quires 9

Valids, Interval Bounds for Values Pair of equal-size posits for lower and upper bounds of value, e.g. a [a <=>, a?@a? ] Each posit ends in a ubit, indicating closed bounds [] or open bounds () or a mix of both (], [) Representation of connected sets of real numbers. These can be closed, open, half-open, bounded, or unbounded. Arithmetic for valids is algebraically closed under elementary operations and many standard functions, i.e. for all valids A, B, and all relevant functions F, A + B, A B, A B, O, F(A) are valids P Calculus is free of exceptions March 28, 2018 Verification of Numerical Results using Posits, Valids and Quires 10

Naïve Application of Intervals / Valids Interval evaluation F X of a function f x : replace all floating-point operations by interval operations Usually overestimates the range of the function on interval X range f, X = f x x X} Example: f x = x x = 0, X = [0,1], range f, X = [0,0], but F X = 0,1 0,1 = 1,1 Help: subdivideinterval (under some conditions): F 0, 0.5 F 0.5,1 = 0.5,0.5 0.5,0.5 = 0.5,0.5 Further subdivision: nearly arbitrarily high accuracy But: higher costs, less efficiency, especially in multidimensional cases March 28, 2018 Verification of Numerical Results using Posits, Valids and Quires 11

Better Application of Intervals / Valids Do not compute everything with valids too expensive, too inaccurate Transform expressions to form which is better to evaluate Avoid (if possible) variables to occur more than once Apply exact dot products / quires (next slides) Use better algorithms (next slides) Do major part of calculation in floating-point and only remainders (between exact and computed values) in interval arithmetic March 28, 2018 Verification of Numerical Results using Posits, Valids and Quires 12

Exact Dot Products, Quires Generalization of fused multiply and add ] ] Fused sum @^_ a @ and fused dot product @^_ a @ b @ computed with only one final rounding for any floating-point numbers / posits a @, b @ ] Round result to nearest posit p = round ( a @ b @ ) @^_ Round result to enclosing valid v = v <=>, v?@a? = ] roundout ( a @ b @ ) @^_ Store intermediate values exactly, e.g. ] s = @^_ a @ b @, s exact s _ = round s, s & = round s s _ quadruple precision result as sum of two posits March 28, 2018 Verification of Numerical Results using Posits, Valids and Quires 13

Software and Hardware Solutions for Quires Many options available for high performance implementations Storage in long fixed-point accumulator; pipelined parallelized operation in one clock cycle Quires: exact arithmetic operations are much faster than memory access Alternative implementations: e.g. sum and remainder operation [Bo 1978], [Bo 1990], many recent publications e.g. by [Rump] March 28, 2018 Verification of Numerical Results using Posits, Valids and Quires 14

Dot Product symbolized by a drawer Only 3 words have to be computed in any accumulation Other words may be affected by carries or borrows These words are not modified in storage, but flags (red / white dots) are used to store this information March 28, 2018 Verification of Numerical Results using Posits, Valids and Quires 15

Coprocessor XPA 3233 for Exact Dot Products Prototypes built in 1995 Coprocessor for Intel processor Faster than conventional non-exact dot products Intended as demonstration of technology Similar development 2017 presented on ARITH 24 in London [Koenig / Berkeley] March 28, 2018 Verification of Numerical Results using Posits, Valids and Quires 16

Alternative Implementation of Quire Repeated sum with exact remainder [Bo 1978], graphics taken from [Bo 1990] x _ (g) converges very quickly to quire result (rounded value of exact sum) Pipelining possible March 28, 2018 Verification of Numerical Results using Posits, Valids and Quires 17

Validated Results of Numerical Algorithms Classical numerical algorithms compute approximations of result Possibly error estimations, but no rigorous bounds New algorithms should compute Rigorous validated bounds for result Proof of existence of solution (If possible) proof of uniqueness of solution This can be achieved using valids (interval arithmetic) and quires (exact dot products) March 28, 2018 Verification of Numerical Results using Posits, Valids and Quires 18

Special Algorithms for Valids and Quires Posit / floating-point evaluation at many points: no certainty about zeroes in range Valid / interval evaluation: certainty about subintervals not containing zeroes Global optimization may use this information for fast elimination of regions March 28, 2018 Verification of Numerical Results using Posits, Valids and Quires 19

Newton Method with Valids If N X is a subset of X, this proves that f x has exactly one zero in X If intersection N X X is empty, this proves non-existence of zero Computation of a sequence X @ of more and more accurate valids containing the exact zero (provided that intersection N X X is not empty) March 28, 2018 Verification of Numerical Results using Posits, Valids and Quires 20

Validated Linear System Solver Solve linear system Ax = b with unknown exact solution x Compute approximate inverse R, approximate solution x ~ using posit arithmetic Do not compute an interval inclusion of x directly But compute an interval inclusion E of the error e = x x ~, using valids, giving much higher accuracy Compute residual r = b A x ~ and sequence of intervals E @p_ = I R A E @ + R r Computation of these expressions in conventional floating-point arithmetic could be worthless (cancellation in subtractions!) Use valids to obtain interval bounds and quires to achieve high accuracy, then under some conditions x x ~ + E @ (valid containing result) March 28, 2018 Verification of Numerical Results using Posits, Valids and Quires 21

Linear System Solver Using Valids and Quires R = inverse (A) X~ = R b, B = I R A, r = b A X~ E = R r Z = E, i = 0 Repeat i = i + 1 Y = blow (E, eps) // posit arithmetic // valid and quire // valid and quire // valid // valid, make interval wider E = B Y + Z // valid and quire Until E is subset of interior of Y or i = 10 // valid March 28, 2018 Verification of Numerical Results using Posits, Valids and Quires 22

Interpretation of Result All operations can be implemented easily with valids and quires Test E is subset of interior of Y is easy to perform, some comparisons of bounds with < and > instead of and If E is subset of interior of Y, this is a rigorous proof that The matrix A is not singular The linear system Ax = b has a unique solution The true solution x of the linear system is contained in the interval / valid vector X~ + E Otherwise, a more refined algorithm is needed (e.g. Rump method, represent R by value and remainder R = R _ + R & using quires); possibly A is singular, i.e. no solution exists March 28, 2018 Verification of Numerical Results using Posits, Valids and Quires 23

Evaluation of Polynomials and Expressions May be transformed in a system of linear equations Polynomial evaluation in form of Horner scheme p(x) = (( a ] x + a ]u_ x + ) x + a _ ) x + a 5 Introduce auxiliary variables p ] = a ], p ]u_ = p ] x + a ]u_,, p 5 = p _ x + a 5 Linear system for unknowns p @ Value of polynomial is p x = p 5 Similar transformation for arithmetic expressions March 28, 2018 Verification of Numerical Results using Posits, Valids and Quires 24

Application, Example Resonances in Turbines Imprecise modelling of eigenfrequencies of rotor (in black) High precision modelling (in red) Turbine exploded in Leipzig (Germany), killing 4 persons and injuring 6 March 28, 2018 Verification of Numerical Results using Posits, Valids and Quires 25

Kulisch s Book 2013 Computer arithmetic, mathematical background Interval arithmetic Design of hardware for e.g. exact dot products / quires Numerical algorithms with verified results Prof Kulisch will celebrate his 85 th birthday in May March 28, 2018 Verification of Numerical Results using Posits, Valids and Quires 26

Conclusion Posits bring higher accuracy than IEEE floating-point operations Valids add the securityof interval operations Quires are essential for the solution of linear systems and many other standard problems of mathematics Implementations of valids and quires with highest performance are required, many algorithms and hardware designs are available Extended programming environments are required for the formulation of algorithms, e.g. C-XSC Verified solutions for applications may require a modification of the underlying model and according new implementation March 28, 2018 Verification of Numerical Results using Posits, Valids and Quires 27