Geometric Predicates P r og r a m s need t o t es t r ela t ive p os it ions of p oint s b a s ed on t heir coor d ina t es. S im p le exa m p les ( i

Similar documents
Agenda Rationale for ETG S eek ing I d eas ETG fram ew ork and res u lts 2

P a g e 5 1 of R e p o r t P B 4 / 0 9

A L A BA M A L A W R E V IE W

P a g e 3 6 of R e p o r t P B 4 / 0 9

176 5 t h Fl oo r. 337 P o ly me r Ma te ri al s

T h e C S E T I P r o j e c t

OH BOY! Story. N a r r a t iv e a n d o bj e c t s th ea t e r Fo r a l l a g e s, fr o m th e a ge of 9

Table of C on t en t s Global Campus 21 in N umbe r s R e g ional Capac it y D e v e lopme nt in E-L e ar ning Structure a n d C o m p o n en ts R ea

Fragment Processor. Textures

6 Lowercase Letter a Number Puzzles

COMPILATION OF AUTOMATA FROM MORPHOLOGICAL TWO-LEVEL RULES

THIS PAGE DECLASSIFIED IAW EO IRIS u blic Record. Key I fo mation. Ma n: AIR MATERIEL COMM ND. Adm ni trative Mar ings.

I M P O R T A N T S A F E T Y I N S T R U C T I O N S W h e n u s i n g t h i s e l e c t r o n i c d e v i c e, b a s i c p r e c a u t i o n s s h o

Dangote Flour Mills Plc

" = Y(#,$) % R(r) = 1 4& % " = Y(#,$) % R(r) = Recitation Problems: Week 4. a. 5 B, b. 6. , Ne Mg + 15 P 2+ c. 23 V,

1. The graph of a function f is given above. Answer the question: a. Find the value(s) of x where f is not differentiable. Ans: x = 4, x = 3, x = 2,

I N A C O M P L E X W O R L D

Beechwood Music Department Staff

Use precise language and domain-specific vocabulary to inform about or explain the topic. CCSS.ELA-LITERACY.WHST D

database marketing Database Marketing Defined Loyalty as Competitive Advantage DBM is Incremental in Nature DBM is a complete framework for Marketing

Executive Committee and Officers ( )

Lesson Ten. What role does energy play in chemical reactions? Grade 8. Science. 90 minutes ENGLISH LANGUAGE ARTS

Bellman-F o r d s A lg o r i t h m The id ea: There is a shortest p ath f rom s to any other verte that d oes not contain a non-negative cy cle ( can

F l a s h-b a s e d S S D s i n E n t e r p r i s e F l a s h-b a s e d S S D s ( S o-s ltiad t e D r i v e s ) a r e b e c o m i n g a n a t t r a c


c. What is the average rate of change of f on the interval [, ]? Answer: d. What is a local minimum value of f? Answer: 5 e. On what interval(s) is f

Gen ova/ Pavi a/ Ro ma Ti m i ng Count er st at Sep t. 2004

THIS PAGE DECLASSIFIED IAW E

I zm ir I nstiute of Technology CS Lecture Notes are based on the CS 101 notes at the University of I llinois at Urbana-Cham paign

Welcome to the Public Meeting Red Bluff Road from Kirby Boulevard to State Highway 146 Harris County, Texas CSJ No.: December 15, 2016

Worksheets for GCSE Mathematics. Quadratics. mr-mathematics.com Maths Resources for Teachers. Algebra

Alles Taylor & Duke, LLC Bob Wright, PE RECORD DRAWINGS. CPOW Mini-Ed Conf er ence Mar ch 27, 2015

Model answers for the 2012 Electricity Revision booklet:

ARC 202L. Not e s : I n s t r u c t o r s : D e J a r n e t t, L i n, O r t e n b e r g, P a n g, P r i t c h a r d - S c h m i t z b e r g e r

Regular Semigroups with Inverse Transversals

Cataraqui Source Protection Area Stream Gauge Locations

Building Harmony and Success

What are S M U s? SMU = Software Maintenance Upgrade Software patch del iv ery u nit wh ich once ins tal l ed and activ ated prov ides a point-fix for

Instruction Sheet COOL SERIES DUCT COOL LISTED H NK O. PR D C FE - Re ove r fro e c sed rea. I Page 1 Rev A

M M 3. F orc e th e insid e netw ork or p rivate netw ork traffic th rough th e G RE tunnel using i p r ou t e c ommand, fol l ow ed b y th e internal

e-hm REPAIR PARTS REPAIR PARTS ReHM R3

Classification of Components

Terms of Use. Copyright Embark on the Journey

How do regular expressions work? CMSC 330: Organization of Programming Languages

Use precise language and domain-specific vocabulary to inform about or explain the topic. CCSS.ELA-LITERACY.WHST D

A A A A A A A A A A A A. a a a a a a a a a a a a a a a. Apples taste amazingly good.

Engine Control <2TR-FE> I

CDS 101/110: Lecture 6.2 Transfer Functions

A/P Warrants. June 15, To Approve. To Ratify. Authorize the City Manager to approve such expenditures as are legally due and

CATAVASII LA NAȘTEREA DOMNULUI DUMNEZEU ȘI MÂNTUITORULUI NOSTRU, IISUS HRISTOS. CÂNTAREA I-A. Ήχος Πα. to os se e e na aș te e e slă ă ă vi i i i i

Patterns of soiling in the Old Library Trinity College Dublin. Allyson Smith, Robbie Goodhue, Susie Bioletti

Software Process Models there are many process model s in th e li t e ra t u re, s om e a r e prescriptions and some are descriptions you need to mode

Using the Rational Root Theorem to Find Real and Imaginary Roots Real roots can be one of two types: ra...-\; 0 or - l (- - ONLl --

Classwork. Example 1 S.35

Journal of Integer Sequences, Vol. 5 (2002), Article

Fr anchi s ee appl i cat i on for m

Building Validation Suites with Eclipse for M odel-based G eneration Tools

CPU. 60%/yr. Moore s Law. Processor-Memory Performance Gap: (grows 50% / year) DRAM. 7%/yr. DRAM

Results as of 30 September 2018

I n t e r n a t i o n a l E l e c t r o n i c J o u r n a l o f E l e m e n t a r y E.7 d u, c ai ts is ou n e, 1 V3 1o-2 l6, I n t h i s a r t

English 1 Name:

This Specification is subject to change without notice

General Strong Polarization

I.U L ~ 32 ~ 2.2 IIII ~~~~ Lg O ~ 2 ~ I I ~~ I.8 101P 25 IIII ~ ~

Magic Letterland. Welcome agic. the. Letterland!

M Line Card Redundancy with Y-Cab l es Seamless Line Card Failover Solu t ion f or Line Card H ardw or Sof t w are Failu res are Leverages hardware Y-

HMX 4681 Kratos. Apollo N CD 5, IP,

INST T N DLS. - Ext t t. Carefully read these instructions before first use. Code: Date: / /201 Rev.:.0

FOR SALE T H S T E., P R I N C E AL BER T SK

The distribution of characters, bi- and trigrams in the Uppsala 70 million words Swedish newspaper corpus

Vero Beach Elks Lodge # th Street Vero Beach, FL /

Lecture No. 1 Introduction to Method of Weighted Residuals. Solve the differential equation L (u) = p(x) in V where L is a differential operator

Lesson 7: Linear Transformations Applied to Cubes

7.3 The Jacobi and Gauss-Seidel Iterative Methods

J A D A V PUR U N IV ERS IT Y K O LK AT A Fa cu lty of En gi n eer in g & T e ch no lo gy N O T I C E

Secondary 3H Unit = 1 = 7. Lesson 3.3 Worksheet. Simplify: Lesson 3.6 Worksheet

Quantitative Screening of 46 Illicit Drugs in Urine using Exactive Ultrahigh Resolution and Accurate Mass system

STANDARDIZATION OF BLENDED NECTAR USING BANANA PSEUDOSTEM SAP AND MANGO PULP SANTOSH VIJAYBHAI PATEL

Big Bang Planck Era. This theory: cosmological model of the universe that is best supported by several aspects of scientific evidence and observation

Definition: A sequence is a function from a subset of the integers (usually either the set

TSOKOS READING ACTIVITY Section 7-2: The Greenhouse Effect and Global Warming (8 points)

o C *$ go ! b», S AT? g (i * ^ fc fa fa U - S 8 += C fl o.2h 2 fl 'fl O ' 0> fl l-h cvo *, &! 5 a o3 a; O g 02 QJ 01 fls g! r«'-fl O fl s- ccco

Chapter 22 : Electric potential

CS311 Computational Structures Regular Languages and Regular Expressions. Lecture 4. Andrew P. Black Andrew Tolmach

Support Vector Machines. CSE 4309 Machine Learning Vassilis Athitsos Computer Science and Engineering Department University of Texas at Arlington

Ash Wednesday. First Introit thing. * Dómi- nos. di- di- nos, tú- ré- spi- Ps. ne. Dó- mi- Sál- vum. intra-vé-runt. Gló- ri-

tc., ,if. l/ ft 6 & L 8. livteya.halaf6e feoreox es Pp I +41 Sc C Qn 4-er 70-y Cc, inoor f,?cr LA I }or 1.er

i;\-'i frz q > R>? >tr E*+ [S I z> N g> F 'x sa :r> >,9 T F >= = = I Y E H H>tr iir- g-i I * s I!,i --' - = a trx - H tnz rqx o >.F g< s Ire tr () -s

MATH 1080: Calculus of One Variable II Fall 2018 Textbook: Single Variable Calculus: Early Transcendentals, 7e, by James Stewart.

Provider Satisfaction

NVLAP Proficiency Test Round 14 Results. Rolf Bergman CORM 16 May 2016

Homework 3/ Solutions

Please read carefully. Good luck & Go Gators!!!

ECE4270 Fundamentals of DSP Lecture 20. Fixed-Point Arithmetic in FIR and IIR Filters (part I) Overview of Lecture. Overflow. FIR Digital Filter

Systems of Linear Equations

The Ind ian Mynah b ird is no t fro m Vanuat u. It w as b ro ug ht here fro m overseas and is now causing lo t s o f p ro b lem s.

I/O7 I/O6 GND I/O5 I/O4. Pin Con fig u ra tion Pin Con fig u ra tion

TECHNICAL NOTE AUTOMATIC GENERATION OF POINT SPRING SUPPORTS BASED ON DEFINED SOIL PROFILES AND COLUMN-FOOTING PROPERTIES

Gary Callicoat Available All Day! Blue Plate Specials Monday: Gary s 3-Way Tuesday: Taco Salad Beef Stroganoff Wednesday: Spaghetti n Meatballs

Tausend Und Eine Nacht

Transcription:

Automatic Generation of SS tag ed Geometric PP red icates Aleksandar Nanevski, G u y B lello c h and R o b ert H arp er PSCICO project h ttp: / / w w w. cs. cm u. ed u / ~ ps ci co

Geometric Predicates P r og r a m s need t o t es t r ela t ive p os it ions of p oint s b a s ed on t heir coor d ina t es. S im p le exa m p les ( in 2 D) : Orientation test (in convex hull) does C lie left/right/on the line AB? C B A I nc irc l e test (in Dela una y t r ia ng ula t ion) does D lie in/ou t/on the c irc le ABC? A D B C 2

Geometric Predicates (cont d) O r i e n t a t i o n ( A, B, C ) = W e o n l y c o n s i d e r t h e sign o f a n e x p r e s s i o n i n v o l v i n g +, - a n d 3

Convex Hull Miscomputed U s i n g O r i e n t a t i o n P r e d i c a t e i n e x a c t a r i t h m e t i c B U s i n g O r i e n t a t i o n P r e d i c a t e i n f l o a t i n g -p o i n t a r i t h m e t i c B C D C D E E A A!! F l o a t i n g p o i n t a r i t h m e t i c e r r s i n c o n s i s t e n t l y!! 4

Floating-p p oint Filte rr ss G e t correct sign (-1, 0 o r 1 ) o f a n e x a c t e x p r e s s i o n E u s i n g f l o a t i n g -p o i n t! filters out the ea sy c a ses let F = E (X) in floating point if F > e r r or b ou nd th en 1 els e if F > er r o r b o u nd th en 1 els e inc r e as e pr e c is ion a nd r ep ea t o r s w itc h to ex a c t a r ith m etic I f th e c o r r ec t r es u lt is 0, m u s t g o to ex a c t p h a s e 5

Current Methods I n t e r v a l a r i t h m e t i c ( R. E. M o o r e, U. K u l i s c h ) +l i t t l e m o d i f i c a t i o n t o t h e s o u r c e p r o g r a m -d o e s n o t p e r f o r m w e l l i n l o w d e g r e e s S i n g l e -p h a s e f i l t e r s ( F o r t u n e & V a n W y k, L E D A ) +c o m p i l e r a v a i l a b l e -s u r p a s s e d b y m u l t i -p h a s e f i l t e r s 6

Current Methods (cont d) M u l t i -p h a s e f i l t e r s ( J. S h e w c h u k ) f o u r p h a s e s o f i n c r e a s i n g p r e c i s i o n +r e -u s e o f r e s u l t s f r o m e a r l i e r p h a s e s +b e t w e e n 8-3 5 % s l o w e r t h a n f p i m p l e m e n t a t i o n -r e q u i r e s e s t i m a t i n g r o u n d i n g e r r o r s -i n v o l v e d a n d h a r d t o i m p l e m e n t : S h e w c h u k s I n s p h e r e C i m p l e m e n t a t i o n > 5 0 0 l i n e s o f c o d e -o n l y e x i s t i n g a r e 2 D a n d 3 D O r i e n t a t i o n a n d I n s p h e r e p r e d i c a t e s, b u t w e n e e d m o r e 7

Functional p r og r am COMPILER num e r ical analy s is S tag e d g e om p r e d icate e tr ic 8

Contributions S o u r c e l a n g u a g e e x p r e s s i o n i n v o l v i n g +, -, a r i t h m e t i c t o b e p e r c e i v e d a s e x a c t n e s t e d a n o n y m o u s f u n c t i o n s ( s t a g i n g ) C o m p i l e r t o M L ( o r C ) m u l t i -p h a s e t a r g e t c o d e e r r o r b o u n d s e s t i m a t e d a u t o m a t i c a l l y f o r m a l l y s p e c i f i e d ( s o, c a n a r g u e c o r r e c t n e s s ) 9

Staging T o t e s t a s e t o f p o i n t s f o r p o s i t i o n w i t h r e s p e c t t o l i n e A C : -c o m p u t e a s m u c h a s p o s s i b l e k n o w i n g o n l y A a n d C -r e t u r n t h e r e m a i n i n g w o r k a s f u n c t i o n -a p p l y t h i s f u n c t i o n t o e a c h o f t h e p o i n t s A C 10

Overview I n t r o d u c t i o n A r b i t r a r y p r e c i s i o n a r i t h m c o m p u t i n g i n p h a s e s S t a g e c o m p i l a t i o n P e r f o r m a n c e C o n c l u s i o n s a n d F u t u r e W e t i c a n d o r k 11

Notation O p e r a t i o n s : EE xx aa cc tt + - FF ll oo aa tt ii nn g g pp oo ii nn tt ª P r e c i s i o n p = # b i t s i n m M a c h i n e E p s i l o n a n t i s s a - i f o p e r a t i o n r e s u l t i s 1. 0, t h e n t h e r o u n d i n g e r r o r i s s m a l l e r t h a n - 12

Error recovery Theorem. (Knuth) If x = a b, t h e r o u n d i n g e r r o r o f x c a n b e r e c o v e r e d b y fl o a t i n g -p o i n t o p e r a t i o n s. If i s t h e r o u n d i n g e r r o r, a n d c = x ª a t h e n S o e x a c t l y. 13

How to Increase Precision? K n u t h s t h e o r e m : P a i r ( x, ) t w i c e t h e p r e c i s i o n. ( D. P r i e s t ) S o r t e d l i s t o f f p -n u m b e r s a r b i t r a r y p r e c i s i o n. E x p a n s i o n = l i s t o f m a g n i t u d e d e c r e a s i n g n o n - o v e r l a p p i n g f l o a t s 1. 0 1 0 1 0 2 120 1. 1 0 1 0 0 2 6 7 + 1. 0 0 1 1 1 2 10 1 0 1 0 1 0 0 0 0 0 0... 0 1 1 0 1 0 0 0 0 0 0 0 0............. 0 0 1 0 0 1 1 1 0 0 0 0 14

Phases and re-u u se ( J. S h e w c h u k ) A r bi t r a r y p r e c i s i o n a r i t h m e t i c p h a s e s c a n r e u s e t h e r e s u l t s o f t h e i r p r e d e c e s s o r s. E x a m p l e : L e t a 1 b 1 = x 1 + 1 a n d a 2 b 2 = x 2 + 2. E x p a n d E a s 15

Phases and re-u u se (( cc oo nt d) S t r a t e g y f o r f i n d i n g t h e sign o f E v a l u a t e E i n p h a s e s, i n c r e a s i n g p r e c i s i o n o n d e m a n d. E x a m p l e : floating point phase ex ac t phase 16

Reusing results A x1 x 1 x 2 x 2 17

Reusing results A B x1 x 1 x 2 x 2 18

Reusing results C A B x1 x 1 x 2 x 2 2x 1 1 2x 2 2 19

Reusing results D C A B x1 x 1 x 2 x 2 2x 1 1 2x 2 2 1 1 2 2 20

Overview I n t r o d u c t i o n A r b i t r a r y p r e c i s i o n a r i t h m c o m p u t i n g i n p h a s e s S t a g e c o m p i l a t i o n P e r f o r m a n c e C o n c l u s i o n a n d F u t u r e W e t i c a n d o r k 21

Source Language B a s i c a r i t h m e t i c o p e r a t i o n s : +, -,, u n a r y -, s q A s s i g n m e n t s : v a l x = s o m e e x p r e s s i o n N e s t e d a n o n y m o u s f u n c t i o n s E x a m p l e : I m p l i c i t s i g n t e s t a t t h e l a s t a s s i g n m e n t. 22

Stage compilation E v e r y s t a g e c o m p i l e d i n t o : -f l o a t i n g -p o i n t c o d e ( p h a s e A ) -c o d e f o r e s t i m a t i n g t h e r o u n d i n g e r r o r L a t e r p h a s e s ( B, C a n d D ) s u s p e n d e d u n t i l e x p l i c i t l y e x e c u t e d 23

Stage 1 H e l p e r c o d e : - -m o d u l e s f o r a r b i t r a r y p r e c i s i o n a r i t h m e t i c C o m p i l e r o u t p u t : A C B D 24

Stage 2 A C B D 25

Overview I n t r o d u c t i o n A r b i t r a r y p r e c i s i o n a r i t h m c o m p u t i n g i n p h a s e s S t a g e c o m p i l a t i o n P e r f o r m a n c e C o n c l u s i o n a n d F u t u r e W e t i c a n d o r k 26

Performance E x p e r i m e n t s t o m a t c h S h e w c h u k s h a n d -g e n e r a t e d p r e d i c a t e s T a r g e t l a n g u a g e C N o s t a g i n g! OO rr ii ee nn tt 22 DD OO rr ii ee nn tt 33 DD II nn CC ii rr cc ll ee II nn SS pp hh ee rr ee UU nn ii ff oo rr m m RR aa nn dd oo m m PP oo ii nn t t DD ii ss tt rr ii bb uu tt ii oo nn S h e w c h u k s v e r s i o n 0. 2 0 8 m s 0. 7 0 7 m s 6. 4 4 0 m s 1 6. 4 3 0 m s A u t o m a t i c a l l y g e n e r a t e d v e r s i o n 0. 2 4 9 m s 0. 7 7 2 m s 5. 6 0 0 m s 3 9. 2 2 0 m s S l o w d o w n 1. 2 0 1. 0 9 0. 8 7 2. 3 9 27

Performance (cont d) uu nn ii ff oo rr m m rr aa nn dd oo mm tt ii ll tt ee d d gg rr ii dd 2D De ll aa uu nn aa y y TT rr ii aa nn gg uu ll aa tt ii oo nn S h e w c h u k s v e r s i o n 1 1 8 7 m s 20 6 0 m s A u t o m a t i c a l l y g e n e r a t e d v e r s i o n 1 4 1 0 m s 3 6 7 8 m s S l o w d o w n 1. 1 9 1. 7 8 cc oo -c c ii rr cc uu ll aa rr 1 1 9 0 m s 1 5 7 8 m s 1. 3 3 B e t w e e n 1 a n d 2. 4 t i m e s s l o w e r t h a n h a n d -g e n e r a t e d c o d e P o s s i b i l i t y f o r i m p r o v e m e n t w i t h a b e t t e r t r a n s l a t i o n t o C 28

Future Work E x t e n d t h e l a n g u a g e : -m u l t i p l i c a t i o n b y 2 n d o e s n t i n t r o d u c e e r r o r s. -s u m m a t i o n o f m o r e t h a n 2 e l e m e n t s c a n b e d o n e q u i c k e r. E v a l u a t e t h e e f f e c t s o f s t a g i n g. A l l o w b e t t e r c o n t r o l o v e r t h e F P a r i t h m e t i c i n S M L. -p r o c e s s o r f l a g s -p r e c i s i o n o f i n t e r n a l F P r e g i s t e r s D e s i g n a l a n g u a g e t h a t c a n c o m p i l e a n d run t h e p r e d i c a t e s -r u n -t i m e c o d e g e n e r a t i o n a n d m e t a -p r o g r a m m i n g -a p p l i c a t i o n : r o b u s t s o l i d m o d e l e r 29

Conclusions Automated conversion o f e x a c t p r e d i c a t e s i n t o f l o a t i n g p o i n t c o d e : p r e s e r v e s c o r r e c t n e s s o f c o m c o m p i l e -t i m e e r r o r a n a l y s i s n e s t e d a n o n y m o u s f u n c t i o n s ( s t a g i n g ) p e r f o r m c o d e p u t a t i o n d e s p i t e r o u n d i n g a n c e o f g e n e r a t e d p r e d i c a t e s c l o s e t o h a n d -g e n e r a t e d F ormal sp ecif ication o f t h e c o m p i l e r. M ore control n e e d e d o v e r f l o a t i n g p o i n t i n S M L. -p r o c e s s o r f l a g s -p r e c i s i o n o f i n t e r n a l F P r e g i s t e r s C omp il er c a n b e f o u n d a t h t t p : / / w w w.c s.c m u.e d u / ~ p s c i c o 30

Operations on Expansions (arbitrary precision arithmetic) Example: Adding two expansions E = e1 e3 e5 F = e e 2 4 Merge Lists e e 1 2 e e e 3 4 5 H = h h h h4 h 5 1 2 3 31

Source Language B a s i c a r i t h m e t i c o p e r a t i o n s : +, -,, s q, u n a r y A s s i g n m e n t s : v a l x = s o m e e x p r e s s i o n N e s t e d a n o n y m o u s f u n c t i o n s ( s t a g i n g ) 32

Compiling a Program C A D B 33

Compiling a Program (cont d) A reused 34

Here goes example for OO ri en tt 22 D D ii n n SS MM L L or CC Nothing! They are just often mistaken for real numbers. type pnt=real*real f u n o ri ent( A : pnt, B : pnt, C : pnt) = let v al ( a1, a2 ) = A v al ( b 1, b 2 ) = B v al ( c 1, c 2 ) = C v al d = ( c 1 -a1 ) *( c 2 -b 2 ) - ( c 2 -a2 ) *( c 1 -b 1 ) i n i f d > 0 th en L ef t els e i f d < 0 th en R i g h t els e O n end 35

What s Wrong With Floating PP oint NN uu mm bb ee rs? Floats are unevenly distributed on the real axis, thus introduc ing rounding errors in the c om p utation. 36

What s Wrong? (cont d) Example: Assume precision of 2 decimal digits. Denote th e operation of ( rounded) addition on floats. F lo at s ar e a subset b u t N O T a subty p e o f r at i o n als an d r eals. 37

+ - Types of Numbers Real numbers Usually assumed when dev elo p i ng o r p r o v i ng alg o r i t hms B asi c o p er at i o ns no t c o mp ut ab le + - Rat i o nal numbers C lo sed under b asi c o p er at i o ns S lo w + - - F lo at i ng -p o i nt numbers F ast N o t c lo sed under b asi c ar i t hmet i c o p er at i o ns ( r o undi ng er r o r s) D o no t sat i sf y usual laws li k e asso c i at i v i t y, di st r i b ut i v i t y 38

Phase A Compilation J u d g m e n t. S e l e c t e d r u l e s 39

Phase B Compilation J u d g m e n t. S e l e c t e d r u l e s 40

Operations on Expansions Example: Adding a double to an expansion. e1 e2 e3 e4 sum sum sum sum roundoff roundoff roundoff roundoff b h 1 h 2 h 3 h 4 h 5 41

Overlapping and Machine ε p b i t s 10101010 000.10 p b i t s 10001010 01011 10101010 000.10..10001010 01011 a n d x d o n o t o v e r l a p 2 -p x. I n I E E E d o u b l e p r e c i s i o n, p= 5 3. 42

Phases of Increasing Precision let R = F (X) in floating point if ab s (R) > estimated error bound th en s ign(r) els e inc rease p rec ision and r epeat or s w itc h to ex ac t ar ith m etic floating point phase inter m ed iate phases ex ac t phase F initel y many intermediate p h ases! 43

Arithmetic R ational nu m + e x a c t - s l o w b e r s Floating-p oint nu m b e r s - i n e x a c t + f a s t 44

Non-ov ov ee rr ll aa pp pp ii ng T h e r o u n d e d s u m x a n d i t s r o u n d i n g e r r o r d o n o t o v e r l a p. 1 01 01 01 0 000.1 0 0000 0.00 0000 000 1 0001 01 0 01 01 1 1 01 01 01 0 000.1 0.. 1 0001 01 0 01 01 1 M a t h e m a t i c a l l y, 45

m Expansions and Compiler Exact e xp r e s s i o n F c om p i l a t i on filters out the ea sy c a ses let R = F (X) in floating point if R > error bound th en 1 els e if R > er r or b ou nd th en 1 els e i nc rea s e p rec i s i on and r epeat or s w itc h to ex ac t ar ith m etic U s e ex pans ions for or e pr ec is e c om pu tations 46

Phases and Compiler Exact e xp r e s s i o n F let R = F (X) in floating point if R > error bound th en 1 els e if R > er r or b ou nd th en 1 els e R2 = ph as e B if ab s (R2 ) > er r or b ou nd th en s ign(r2 ) els e R3 = ph as e C if ab s (R3 ) > er r or b ou nd th en s ign(r3 ) els e c om p i l a t i on R4 = ph as e D ; (* ex ac t ph as e * ) s ign (R4 ) 47

Bounding the Rounding Error F l o a t i n g -p o i n t o p e r a t i o n s a r e c o r r e c t l y r o u n d e d. C o n s e q u e n c e : f o r a n y o p e r a t i o n 2 { +, -, } N o t i c e : ε i s s t a t i c p a r t o f t h e e r r o r w h i l e x y i s d y n a m i c. 48

Bounding Error of Composite Ex pressions I f X 1 = x 1 δ 1 p 1 a n d X 2 = x 2 δ 2 p 2 t h e n 49

Error Bounds and CC om pp ii ll at ii on S t a t i c e r r o r b o u n d -O b t a i n e d E X A C T L Y i n c o m p i l e -t i m e. -R o u n d e d a n d t h e n e m i t t e d i n t o t h e t a r g e t p r o g r a m a s a f l o a t i n g -p o i n t c o n s t a n t. D y n a m i c e r r o r b o u n d -C o d e m u s t b e g e n e r a t e d f o r i t s c o m p u t a t i o n a n d e m i t t e d i n t o t h e t a r g e t p r o g r a m. 50

Error Bounds and Compilation (( cc ont d) compilation Exact e xp r e s s i o n F let R = F (X) in floating point d y nam ic _ er r or = D (X) er r or = s tatic _ er r or * d y nam ic _ er r or if R > er r or th en 1 els e if R > er r or th en 1 els e j u m p to ph as es B, C and D 51

Compilation example S o u r c e e x p r e s s i o n c ( a + b ) 2 T a r g e t S t a n d a r d M L p r o g r a m : 52

Source Language B a s i c a r i t h m e t i c o p e r a t i o n s : +, -,, s q, u n a r y - A s s i g n m e n t s : v a l x = s o m e e x p r e s s i o n N e s t e d a n o n y m o u s f u n c t i o n s 53

Staging (cont d) 54

Overview I n t r o d u c t i o n A r b i t r a r y p r e c i s i o n a r i t h m c o m p u t i n g i n p h a s e s M u l t i -s t a g e f i l t e r s P e r f o r m a n c e C o n c l u s i o n a n d F u t u r e W e t i c a n d o r k 55