Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site alice.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!alice!ark From: ark@alice.UucP (Andrew Koenig) Newsgroups: net.arch,net.math Subject: Re: IEEE f.p. standard Message-ID: <5335@alice.uUCp> Date: Mon, 21-Apr-86 11:15:13 EST Article-I.D.: alice.5335 Posted: Mon Apr 21 11:15:13 1986 Date-Received: Wed, 23-Apr-86 12:36:36 EST References: <2048@lanl.ARPA> Organization: Bell Labs, Murray Hill Lines: 32 Xref: watmath net.arch:3144 net.math:3105 > COS(X) is defined as SIN(X-PI/2). Now for |X| <= PI, we require that > SIN(X) = RND(sin(X)). This is the correctly rounded value of the function > value. Unfortunately, even this fairly simple definition is quite hard to implement. Consider the problem of rounding an infinite-precision real number to its nearest representable value. Conceptually, this process involves cutting the fraction somewhere and manipulating the bits before the cut in a way that depends on the value of the bits after the cut. For instance, if you're rounding a positive value toward infinity, you will increment the bits before the cut if any of the bits after the cut are non-zero. If all the bits after the cut are zero, you must leave the bits before the cut alone. This implies that it's not easy to place an upper bound on the precision you need to get a correctly rounded value of a transcendental function. Essentially, you need to be able to distinguish these cases: xxxxxxx0|111111111111... xxxxxxx1|000000000000... where the bar represents the cut point. If rounding toward infinity, the first case must round up to xxxxxxx1, while the second case either rounds down to xxxxxxx1 (if all the bits after the cut are 0) or up to yyyyyyy0 (where any bit is nonzero after the cut and yyyyyyy=xxxxxxx+1) In other words, when rounding toward infinity, you must generate bits after the cut until you know there's a nonzero bit, and it's hard to know how much precision you need to get it right. Similar situations occur in different places in other rounding modes.