How feasible is it to do arithmetic directly in this representation?
Iterated Log Coding
31–40 of 40 posts
Re: Iterated Log Coding
#32Earlier quoted context omitted.
It is not. (There are no square roots, for instance.)
It very much is. sqrt(x) is just x^(1/2) which is x^(2^-1). Dirac's solution is using iterated square root of 2, effectively generating a sequence similar to what's used in this post.
Re: Iterated Log Coding
#33Re: Iterated Log Coding
#34> Any value representable in n bits is representable in n+1 bits > [1 1 1 1 1 1 1] 2.004e+19728 Does that mean that the 8 bits version has numbers larger than this? Doesn't seem very useful for 10^100 is already infinity for all practical purposes.
Who said anything about practical purposes?
Re: Iterated Log Coding
#35Earlier quoted context omitted.
Who said anything about practical purposes?
I usually like my float representations to have some use. But sure, this does seem like a very interesting idea.
If this does have some use, I don’t think representing real-world numbers is one of them, for the reasons you intuited.
Re: Iterated Log Coding
#36Isn't this just a variant of Dirac's solution for representing any number using sqrt, log, and the number 2?
Re: Iterated Log Coding
#37Isn't this just a variant of Dirac's solution for representing any number using sqrt, log, and the number 2?
Not really. Dirac's trick works entirely at a depth of two logs, using sqrt like unary to increment the number. It requires O(n) symbols to represent the number n, i.e. O(2^n) symbols to represent n bits of precision. This thing has arbitrary nesting depth of logs (or exps), and can represent a number to n bits of precision in O(n) symbols.
Still seems a fairly simple variation once you remove the arbitrary restriction. To the point: I don't believe for a second that anyone familiar with his solution, asked to make it more bit efficient, would not have come up with this. Nor do I believe they would call it anything other than a variation.
That doesn't make it less cool but I don't think it's like amazingly novel.
Re: Iterated Log Coding
#38Earlier quoted context omitted.
It very much is. sqrt(x) is just x^(1/2) which is x^(2^-1). Dirac's solution is using iterated square root of 2, effectively generating a sequence similar to what's used in this post.
Okay, but iterating square roots like √√2 = (2^(2^-1))^(2^-1) recurses into the base, whereas the equivalent iterated log is 2^(2^-1 × 2^-1) = 2^(2^-2) = +2^(+2^(-2^(+2^0))) with the bit representation [1 1 0 0 1 0 0 ...], i.e. it recurses into the exponent.
Dirac's solution was also arbitrarily restricted by the problem definition.
Do you believe that if you asked someone familiar with the solution to come up with a bit efficient variant they would not have trivially come up with the encoding in this post and called it a variation?
I don't, for a second, believe that.
Re: Iterated Log Coding
#39It's a neat encoding but the writeup is needlessly confusing. The introduction would really benefit from a graph or two. Or even just a textual sequence showing how the value evolves as you iterate on it. Similarly, while the end result is quite elegant the consequences of the choices made to get there aren't really explained. It's quite a bit of extra effort to reason out what would have happened if things had been…
Agree, I had to ask ChatGPT to explain this to me with an example number and then I was able to understand the approach.