Marc Nieper-Wißkirchen wrote:
> for output, the shortest rounded
> representation that still reads back accurately has to be selected.
> ...
> A simple algorithm is given by Aubrey Jaffer in [1].
> 
> [1] http://people.csail.mit.edu/jaffer/III/EZFPRW

There are several other algorithms for this purpose.

There is an overview by RyanJuckett at
http://www.ryanjuckett.com/programming/printing-floating-point-numbers/

The papers I know of are:

* Guy L. Steele Jr, Jon L White
  "How to Print Floating-Point Numbers Accurately"
  1990

* Robert G. Burger, R. Kent Dybvig
  "Printing Floating-Point Numbers Quickly and Accurately"
  1996

* Florian Loitsch
  "Printing Floating-Point Numbers Quickly and Accurately with Integers"
  2010

* Marc Andrysco, Ranjit Jhala, Sorin Lerner
  "Printing Floating-Point Numbers"
  2016

Then there's also the algorithm, by Michael Stoll and me (1990),
in GNU clisp and CLN (based on multiprecision arithmetic, not hardware floats).

Bruno


Reply via email to