Self-Validated Numerical Methods and Applications
Total Page:16
File Type:pdf, Size:1020Kb
SelfValidated Numerical Metho ds and Applications Jorge Stol Instituto de Computacao Universidade Estadual de Campinas UNICAMP Luiz Henrique de Figueiredo Lab oratorio Nacional de Computacao Cientca LNCC Preface st This monograph is a set of course notes written for the Brazil ian Mathematics Collo quium held at IMPA in July It gives an overview of the eld of selfvalidated numerics computation mo dels in which approximate results are automatically provided with guaranteed error b ounds We fo cus in particular on two such mo dels interval arithmetic and ane arithmetic Interval arithmetic IA was develop ed in the s by Ramon E Mo ore IA is the simplest and most ecient of all validated nu merics mo dels and not surprisingly the most widely known and used After two decades of relative neglect IA has been enjoying a strong and steady resurgence driven largely by its successful use in all kinds of practical applications We are condent that many readers of this monograph will nd IA to b e a useful to ol in their own work as well Ane arithmetic AA is a more complex and exp ensive computation mo del designed to give tighter and more informative b ounds than IA in certain situations where the latter is known to p erform p o orly The AA mo del was prop osed and develop ed recently by the authors al though a similar mo del had b een develop ed in by E R Hansen Apart from its usefulness for certain sp ecial applications AA is b eing presented here as an example of the many topics for research that are still unexplored in the eld of selfvalidated numerical metho ds We ap ologize to the reader for the length and verb osity of these notes but likePascal we didnt have the time to make them shorter Je nai fait celleci plus longue que parce que je nai pas eu le loisir de la faire plus courte Blaise Pascal Lettres Provinciales XVI i ii Acknowledgements st We thank the Organizing Committee of the Brazilian Mathematics Collo quium for the opp ortunity to present this course We wish to thank Joao Comba who help ed implementa prototyp e ane arithmetic package in Mo dula and Marcus Vinicius Andrade who help ed debug the C version and wrote an implicit surface raytracer based on it Ronald van Iwaarden contributed an indep endent imple mentation of AA and investigated its p erformance on branchandb ound global optimization algorithms Douglas Priest and Helmut Jarausch provided co de and advice for rounding mo de control We wish to thank also Sergey P Shary and Lyle Ramshaw for valu able comments and references and Paulo Correa de Mello for the use of his computing equipment The authors research has been supp orted over the years partly by grants from Brazilian research funding agencies CNPq CAPES FAPESP FAPERJ and by the State University of Campinas UNI CAMP the Pontical Catholic University of Rio de Janeiro PUCRio the Institute for Pure and Applied Mathematics IMPA the National Lab oratory for Scientic Computation LNCC and Digitals Systems Research Center DEC SRC in Palo Alto Figures and were generated with Geomview Figure was generated with xfarbe Figures and were kindly provided by Luiz Velho The other gures were generated with software written by the authors Jorge Stol Luiz Henrique de Figueiredo Instituto de Computacao UNICAMP Lab Nacional de Computacao Cientca Caixa Postal Rua Lauro Muller Campinas SP Brazil Rio de Janeiro RJ Brazil stolfidccunicampbr lhflnccbr May Contents Intro duction Approximate computations Error mo dels Floatingp ointnumber systems The IEEE oatingp oint standard Interval arithmetic Intro duction Intervals Computing with IA Sp ecic op erations Utility op erations The error explosion problem Avoiding error explosion Ane arithmetic Ane forms Joint range of ane forms Sp ecial ane forms Conversions b etween IA and AA Computing with AA Ane op erations Nonane op erations Optimal ane approximations Square ro ot The minrange approximation Exp onential iii iv Contents Recipro cal Multiplication Division The mixed AAIA mo del Comparing AA and IA Implementation issues Optimization techniques Hansens Generalized Interval Arithmetic Some applications Zeros of functions Level sets Ray tracing Global optimization Surface intersection Bibliography Chapter Intro duction Approximate computations Many numerical computations esp ecially those concerned with mo d eling physical phenomena are inherently approximate they will not deliver the true exact values of the target quantities but only some values that are in some sense near the true ones Approximate numerical computation has been an essential to ol of science and technology for several centuries The history of the eld is actually as long as that of science itself the ancient Babylonians were already computing recipro cals and square ro ots as truncated sexagesimal a fractions One of Archimedess bestknown endeavors was numerical approximation algorithm for The greatest mathematicians of mo dern history such as Newton and Gauss were deeply concerned with this eld The rst electronic computers were expressly designed for numerical computing and that application is still an overriding concern in the design of mo dern CPU chips Error analysis The dierence between a computed value and the true value of the corresp onding quantity is commonly called the error of that computed value Some sources of error are external to the computation the inputs mayhave b een contaminated by measurement error or missing data or Intro duction the computation may b e based on a simplied mathematical mo del that later proves to b e inadequate Other sources of error are internal due to the discrete nature of digital computing to resource limitations on computing time storage capacity or program complexity or to compatibility constraints such as hardware oatingp oint formats and decimal inputoutput conver sion These factors usually force the original mathematical mo del to b e replaced by a discrete approximation with nite steps truncated series rounded arithmetic etc The accuracy of numeric algorithms is notoriously hard to analyze In practice it is often imp ossible or unfeasible to predict mathematically the magnitude of the roundo and truncation errors hidden in the output of a numeric program In order to be truly useful every approximate numerical pro cedure must be accompanied by an accuracy specication a statement that denes the magnitude of the errors in the output values usually as a function of the input values and their errors The accuracy sp ecication must b e supp orted byanerror analysis a mathematical pro of that the output errors ob ey the sp ecications Unfortunatelyeven for relatively simple algorithms a rigorous error analysis is often prohibitively long or dicult or b oth Moreover a useful accuracy sp ecication often requires that the inputs satisfy a host of prerequisitesthis matrix must be wellconditioned that function must have b ounded derivatives these formulas should not overow etc In practice these prerequisites are often imp ossible to guarantee or even to check As a consequence numerical algorithms are often put to use without accuracy sp ecications much less a prop er error analysis Interpretation of the results is left to the user who must rely on his intuition crude tests or pure luck This unfortunate state of aairs has even led to prejudice against approximate numerical computing in contemp orary computer science tsuccess in applications The eld is despite its imp ortance and eviden generally p erceived by outsiders as sloppy and fuzzy and hence not really precise and scientic and hence not a resp ectable part computer sciencewhere as in mathematics there is no place for things that are correct Approximate computations A simple and common approach for estimating the error in a oating point computation is to rep eat it using more precision and compare the results If the results agree in many decimal places then the computa tion is assumed to be correct at least in the common part However this common practice can b e seriously misleading as the following sim ple example by Rump shows Consider the evaluation of f y x x y y y y xy for x and y Note that x y and all co ecients in f are exactly representable in oatingp oint b e it binary or decimal that computing f in FORTRAN on a IBM S Rump rep orts mainframe yield f using single precision f using double precision f using extended precision Since these three values agree in the rst seven places common practice would accept the computation as correct However the true value is f not even the sign is right in the computed results Similar results can b e obtained with Maple x y evaluate in floating point fyxxyyyyxy f evaluate in exact rational arithmetic yyxy fyxxyy