Faster binary-to-decimal conversion

Nelson H. F. Beebe beebe at math.utah.edu
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"}

@Article{Adams:2018:RFF,
  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 =          "https://doi.org/10.1145/3296979.3192369",
  ISSN =         "0362-1340 (print), 1523-2867 (print), 1558-1160
                 (electronic)",
  ISSN-L =       "0362-1340",
  bibdate =      "Wed Oct 16 14:12:57 MDT 2019",
  bibsource =    "http://www.math.utah.edu/pub/tex/bib/fparith.bib;
                 http://www.math.utah.edu/pub/tex/bib/sigplan2010.bib",
  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
                 implementation.",
  acknowledgement = ack-nhfb,
  fjournal =     "ACM SIGPLAN Notices",
  journal-URL =  "http://portal.acm.org/browse_dl.cfm?idx=J706",
  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 math.utah.edu  -
- 155 S 1400 E RM 233                       beebe at acm.org  beebe at computer.org -
- Salt Lake City, UT 84112-0090, USA    URL: http://www.math.utah.edu/~beebe/ -
-------------------------------------------------------------------------------


More information about the gmp-devel mailing list