Faster binary-to-decimal conversion

Nelson H. F. Beebe beebe at
Wed Oct 16 22:27:23 UTC 2019

In another delayed bibliography update, today I found a recent paper
on the problem of exact floating-point binary-to-decimal conversion:

@String{j-SIGPLAN               = "ACM SIG{\-}PLAN Notices"}

  author =       "Ulf Adams",
  title =        "{Ry{\=u}}: fast float-to-string conversion",
  journal =      j-SIGPLAN,
  volume =       "53",
  number =       "4",
  pages =        "270--282",
  month =        apr,
  year =         "2018",
  CODEN =        "SINODQ",
  DOI =          "",
  ISSN =         "0362-1340 (print), 1523-2867 (print), 1558-1160
  ISSN-L =       "0362-1340",
  bibdate =      "Wed Oct 16 14:12:57 MDT 2019",
  bibsource =    ";
  abstract =     "We present Ry{\=u}, a new routine to convert binary
                 floating point numbers to their decimal representations
                 using only fixed-size integer operations, and prove its
                 correctness. Ry{\=u} is simpler and approximately three
                 times faster than the previously fastest
  acknowledgement = ack-nhfb,
  fjournal =     "ACM SIGPLAN Notices",
  journal-URL =  "",
  remark =       "PLDI '18 proceedings.",

The algorithms in that paper are targeted at the 32-, 64-, and 128-bit
IEEE 754 formats, and a 256-bit extended format, and require internal
tables who sizes grows significantly with exponent range.  The author
has made both C and Java implementations of his rather complicated
algorithm, and compares their performance with some of the current
`best' algorithms.

Although GMP and MPFR often are used for arbitrary precision
arithmetic, I suspect that at the end of such computations, results
are often converted to an IEEE 754 format for further use, and
possibly, output in decimal.  Thus, the new Adams algorithm may be of
interest to some members of the GMP and MPFR teams, as well as to the
interval arithmetic community where it is imperative to be able to
maintain correct upper- and lower-bounds of results, including when
they are converted from binary representations in computers to decimal
number strings for humans.

- Nelson H. F. Beebe                    Tel: +1 801 581 5254                  -
- University of Utah                    FAX: +1 801 581 4148                  -
- Department of Mathematics, 110 LCB    Internet e-mail: beebe at  -
- 155 S 1400 E RM 233                       beebe at  beebe at -
- Salt Lake City, UT 84112-0090, USA    URL: -

More information about the gmp-devel mailing list