[HN Gopher] The Irish Logarithm
       ___________________________________________________________________
        
       The Irish Logarithm
        
       Author : 082349872349872
       Score  : 106 points
       Date   : 2023-10-01 17:34 UTC (5 hours ago)
        
 (HTM) web link (blog.plover.com)
 (TXT) w3m dump (blog.plover.com)
        
       | dang wrote:
       | Recent and related:
       | 
       |  _Percy Ludgate_ - https://news.ycombinator.com/item?id=37533487
       | - Sept 2023 (17 comments)
        
         | darraghenright wrote:
         | As an Irish person from Cork, I'm a bit embarrassed I've never
         | heard of him until now.
         | 
         | That said we're probably not great at acknowledging historical
         | figures in the field. George Boole's house is three minutes'
         | walk from my house and it's basically derelict (and was
         | literally falling down at one point). It would be a wonderful
         | building for a museum of his life and achievements.
        
           | sksksndodj wrote:
           | To be fair, figures like Boole and Hamilton are very much
           | celebrated within Irish academia. And it's not a new thing. I
           | attended a conference on the legacy of Boole in 1995:
           | https://www.maths.tcd.ie/pub/ims/bull33/bull33_3-3.pdf
           | 
           | Ludgate is a more marginal case because his invention didn't
           | come to fruition. There is a bit of a sense in which he is
           | being celebrated/hyped in a silly superficial ("collectively
           | narcissistic") way intended to bolster self-esteem for Irish
           | technical people.
           | https://ingeniousireland.ie/2012/10/1909-a-novel-irish-
           | compu...
           | 
           | Meanwhile significant people like Carew Meredith aren't on
           | the public radar at all.
           | https://en.wikipedia.org/wiki/Carew_Arthur_Meredith
        
             | [deleted]
        
       | dundarious wrote:
       | Typo:  uses T_1(a) twice, one should be T_1(b)
        
         | mjd wrote:
         | Fixed, thanks.
        
           | pinkmuffinere wrote:
           | unrelated -- I stumbled across your blog years ago, before I
           | started visiting HN, and have been quite a fan. Thanks for
           | the great blog! I didn't realize you're active on HN, it's
           | fun seeing you on here :)
        
             | mjd wrote:
             | Thanks for your kind words and for reading my blog!
        
               | js2 wrote:
               | I want to thank you for _Higher Order Perl_. It was the
               | book that finally led me to understanding Lisp. :-)
        
           | dundarious wrote:
           | No problem, enjoyed your work.
        
       | nerdponx wrote:
       | Weren't logarithms originally developed by Napier and his
       | successors specifically for the purpose of making multiplication
       | easier? Ludgate's algorithm as written here looks a lot like
       | that.
        
         | sksksndodj wrote:
         | Ludgate's logarithms allow multiplication by addition of
         | indices, but they are not derived from a base, and the indices
         | are all whole numbers. It is an essentially empirical system,
         | unlike the comparable Zech/Jacobi logarithms which are based on
         | number theory.
        
         | dan-robertson wrote:
         | Logarithms allow approximately multiplying numbers with several
         | significant figures. This method compresses _exact_ single-
         | digit multiplication into three exact lookups (with log tables
         | you would instead look for nearby entries) and one addition.
         | Also unlike logarithms, the intermediate integers are quite
         | meaningless. They are a bit like logarithms but severely
         | fiddled with.
        
       | sksksndodj wrote:
       | There's a much simpler way to derive Ludgate's logarithms.
       | 
       | See this article:
       | 
       | https://treasures.scss.tcd.ie/miscellany/TCD-SCSS-X.20121208...
       | 
       | The Python code is old-fashioned, but the description of how the
       | indices are chosen is much much more economical and
       | straightforward than this blog post.
        
         | svat wrote:
         | On the other hand, I find this blog post well-motivated and
         | explains the thought process leading up to an explanation of
         | the tables, while that article just presents a block of Python
         | code that I don't find straightforward at all: I imagine that
         | if someone tried to explain from scratch how to come up with
         | that code, it would actually be _longer_ than this blog post.
        
           | sksksndodj wrote:
           | The article doesn't just present the Python code. There is a
           | figure on the previous page which spells out very cleary how
           | the indices are derived. I'm going to stick to my guns and
           | say that this blog post obfuscates matters.
        
       | reidacdc wrote:
       | This is very cool, as are a lot of older algorithms, and some
       | newer ones. Probably mechanical computers had lots of under-the-
       | hood optimizations that would be interesting to dig into.
       | 
       | It reminds me of e.g. the CORDIC algorithm, used to calculate
       | trig functions (needed by rocket guidance systems) with a
       | combination of fixed-point arithmetic and table look-up.
       | Doubtless there are many others.
       | 
       | CORDIC: https://en.wikipedia.org/wiki/CORDIC
        
       | jepler wrote:
       | A base 8 or 16 version of this might be useful for calculating
       | products on old CPUs without a multiply instruction, without
       | having unreasonably large tables.
       | 
       | One table driven way of accelerating 8x8 bit multiplication with
       | a table of modest size (e.g., 256 words) is
       | https://dercuano.github.io/notes/multiplication-with-squares...
       | -- however since there are 17578 distinct products of two 8 bit
       | numbers, even a full Irish Logarithm table would probably be
       | infeasible to store in most systems where the technique would be
       | relevant. (you've used over 50% of a 16-bit address space on the
       | table) And 6 table look-ups for 4 bits at a time is likely to be
       | slower than 2 table look-ups for the 8-bit square table, even
       | with the extra bit shifting required.
        
         | IshKebab wrote:
         | Would it though? The tables have 45 non-zero elements. The
         | zeros aren't all regularly distributed so you're probably
         | looking at storing way more than that.
         | 
         | A full table with the answers stored directly is only 55
         | elements. Maybe I missed something but what's the point?
         | 
         | Does it scale better than N^2?
        
       ___________________________________________________________________
       (page generated 2023-10-01 23:00 UTC)