An unofficial, read-only Hacker News reader.

Beating Floating Point at Its Own Game: Posit Arithmetic [pdf] (opens external site)

56 points by xenophonf 5 hours ago | www.johngustafson.net | 20 comments on HN

View full thread · View on Hacker News

Comment thread (3)

  1. It's effectively a "slide rule" numerical system so (to avoid intermediate representations) multiplication become addition and addition becomes softmax, right?
    Replies (1)
    1. I'm not sure what you mean by "slide rule" or "softmax" in this context :p but both binary IEEE and posits are essentially encodings of numbers of the form `(fraction / DENOMINATOR) * 2*exponent`, where `fraction` and `exponent` are integers and `DENOMINATOR` is fixed. The same general principles for implementing arithmetic operations apply for both.
      Replies (1)
      1. Oh boy, this is a fun one. :)

        Slide-rules are handy because they convert multiplication into addition. Or technically that's what logarithms do, and slide-rules are a physical implementation of logarithms.

        Recall the classic identity:

        log(x * y) = log(x) + log(y)

        Slide-rules have multiple rulers, and some are marked in log scale, which lets you multiply totally mechanically! By aligning the markings, you effectively add two lengths, which (when read back on the log tick marks) becomes multiplication.

        If you perform the same algebra transform as above, you see that addition becomes (oddly, but more intuitive the more you think about it) the Softmax function.

        https://en.wikipedia.org/wiki/Softmax_function

        This is my first time seeing Posits, but (having had similar ideas loosely inspired by the Doom bit-hacks) I just assumed this was one of the main sales pitches for Posits!