No subject

uunet!ee.lbl.gov!vern uunet!ee.lbl.gov!vern
Sun Feb 25 22:13:33 PST 1996


 Received: from daffy.ee.lbl.gov by relay5.UU.NET with ESMTP 
	id QQaenv13751; Mon, 26 Feb 1996 00:59:55 -0500 (EST)
Received: by daffy.ee.lbl.gov (8.7.1/1.43r)
	id VAA20629; Sun, 25 Feb 1996 21:59:54 -0800 (PST)
Message-Id: <199602260559.VAA20629adaffy.ee.lbl.gov>
To: uunet!tybor.com!tydeman (Fred Tydeman)
Cc: uunet!validgh.com!numeric-interest
Subject: Re: Decimal to binary conversion
Date: Sun, 25 Feb 96 21:59:53 PST
From: Vern Paxson <uunet!ee.lbl.gov!vern>

> Tim Peters in March, 1991, posted to numeric-interest several articles
> on finding decimal numbers that are 'hard' to convert to IEEE-754
> double (a sign bit, 11 exponent bits, a hidden bit, and 52 bits of the
> fraction).  There are hard in that they require many additional bits
> beyond the 53 kept to determine the correctly rounded value and the
> setting (or not) of the inexact flag. 
> 
> I do not recall if anyone else posted any other such tables or their
> results in trying to duplicate finding 'hard' decimal numbers. 

I implemented Tim's algorithm and also fleshed out the proof (using cruder
techniques, since Knuth mystified me :-).  This was done as my project for
a floating-point class at UCB taught by Prof. Kahan.  I think I posted the
results to numeric-interest back in 1991 but I'm not sure.  In any case,
you can get the paper from:

	ftp://ftp.ee.lbl.gov/testbase-report.ps.Z

Here's the table analogous to the one you posted:

Digits	Input			Extra Bits Required
1       $9 \cdot 10^{-265} $  		13    
2       $85 \cdot 10^{-037} $ 		16    
3       $623 \cdot 10^{+100} $        	20    
4       $3571 \cdot 10^{+263} $       	24    
5       $81661 \cdot 10^{+153} $      	26    
6       $920657 \cdot 10^{-023} $     	30    
7       $4603285 \cdot 10^{-024} $    	30    
8       $87575437 \cdot 10^{-309} $   	37    
9       $245540327 \cdot 10^{+122} $  	42    
10      $6138508175 \cdot 10^{+120} $ 	42    
11      $83356057653 \cdot 10^{+193} $	45    
12      $619534293513 \cdot 10^{+124} $	49    
13      $2335141086879 \cdot 10^{+218} $	53    
14      $36167929443327 \cdot 10^{-159} $	57    
15      $609610927149051 \cdot 10^{-255} $	57    
16      $3743626360493413 \cdot 10^{-165} $	63    
17      $94080055902682397 \cdot 10^{-242} $	64    
18      $899810892172646163 \cdot 10^{+283} $	69    
19      $7120190517612959703 \cdot 10^{+120} $	73    
20      $25188282901709339043 \cdot 10^{-252} $	73    
21      $308984926168550152811 \cdot 10^{-052} $	77    
22      $6372891218502368041059 \cdot 10^{+064} $	81    

I only looked for stress inputs for IEEE round-to-nearest.

The paper also gives stress inputs for conversion the other direction,
and for conversion to and from 24 and 56 bit mantissas.

		Vern




More information about the Numeric-interest mailing list