Abstract
Authors of programs that implement mathematical algorithms soon confront the fact that computers do not have real arithmetic. Instead, most computers offer some form of floating-point arithmetic, which can be extremely fast, but is also a paltry substitute for real. Floating-point representation can be understood as scientific notation with a limited number of significant figures. Every floating-point system has a smallest E = 2-k such that 1 + £ > 1; thus (1 + 2) + 2= 1 while 1 + (£2 + 2) = 1 + £ > 1 SQ floating-point addition is not even associative. Each floating-point arithmetic operation may commit a relative error of s; over a long sequence of operations such compounded errors can lead to wildly incorrect answers. An especially acute problem is catastrophic cancellation: the computed difference between two floating-point numbers that are nearly equal may include no significant figures at all, this makes it impossible in general to use floating-point arithmetic to test for exact equality [4]. Sometimes people are tempted to ignore all this and to use floating-point arithmetic as if it were real; numerical analysts have long railed against such "naive" use of floating-point [2]. In computing with geometric objects, one promising approach that has emerged is to confine all (would-be) real arithmetic to a few functions and procedures. The rest of the program manipulates discrete information whether logicalX combinatorial or topological and calls on the arithmetic subprograms only when necessary. In effect these subprograms behave as ;;black boxes": various complicated and ungainly things may happen inside them, but the rest of the program need not be concerned about the details. Of course, this begs the question of how to write arithmetic subprograms that are robust and reliable. This column presents some exact-integer generalized predacates as examples of arithmetic subprograms. These predicates accept exact integers (usually user data) as input compute the value of one or more integer polynomials in these inputs and return as output a member of a small discrete set. For the first example the set is {true, false} so it is a predicate even in the ungeneralized sense. The computation of that example uses the generalized predicate sign ( ) that returns one of { + 1, O, 1}7 depending on the sign of its argument. Since the integer arithmetic native to computers also offers a limited number of digits of precision we shall assume that some multiprecision integer arithmetic is used to compute the values of the polynomials when our integers outgrow the native precision. The many subroutine packages available to perform multiprecision integer arithmetic share at least one property: all run considerably slower than native integer or floating-point arithmetic. The slowdown worsens as the multi-
Talk to us
Join us for a 30 min session where you can share your feedback and ask us any queries you have
Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.