Logarithms
// draft // Notes on their history, implementation in Julia, and use in probabilistic programming
In the summer of 1615, Henry Briggs set out from his home in London en route to Merchiston Castle, a private estate near Edinburgh. His route along the Great North Road would have taken him close by his hometown of Halifax, one of the many villages in Yorkshire hit hard that year by the “The Great Snow of 1615”. Parish registers in the district attributed multiple deaths to the cold and snow during that difficult winter. By the time Briggs was traveling, however, the weather had taken a drastic turn in the opposite direction. The spring’s devastating floods had given way to a hard drought, which spoiled the hay harvest and caused a spike in the price of fodder for horses. Whether Briggs traveled by horse, cart, or on foot, the 300+ mile journey would have been arduous, expensive, and perhaps even dangerous.
At 54, Briggs was not a young man. Nor was his profession one of those typically associated with adventurous travel - he was a mathematician and the inaugural lecturer in Geometry at the newly founded Gresham’s college. A devout puritan, he was, as one colleague put it “contented with his own station, preferring a studious retirement to all the splendid circumstances of life”. So what inspired the professor to take leave of his “studious retirement” to make the long journey north? Was it love? Revenge? Riches? None of the above. It was the very same spirit that animates today’s internet flame wars: someone had written something niche and technical, and Briggs needed to tell them that they were wrong.
That person was John Napier, laird of Merchiston. The book in question: his magnum opus Description of the Wonderful Canon of Logarithms. Published only one year earlier, the work coined the term logarithm, introduced our modern system of decimal notation, and was in no uncertain terms, a smash hit. Kepler dedicated his 1620 Ephemeris (an astronomical almanac) to Napier, and on the tercentenary of the Descriptio’s publication, E.W. Hobson called logarithms “one of the very greatest scientific discoveries that the world has seen.”
The work is short, including only 57 pages of text. The bulk of the volume (over 90 pages) consists of tables, each cell of which contains a single seven digit number. It had taken Napier 20 years of painstaking calculations to generate these numbers. Thus, despite the warm reception by europe’s philosophers and savants, it must have been somewhat discouraging for Napier to have Briggs show up at his doorstep only twelve months later, declaring that all the tables had to be recalculated… in their entirety…
// something about the value of second drafts in all writing/science/math/art etc //
I’m being a bit tongue-in-cheek here. The relationship between the two men was not actually contentious. On the contrary, Briggs wrote in a letter to a friend, “Naper, lord of Markinston (sic), hath set my head and hands a work with his new and admirable logarithms. I hope to see him this summer, if it please God, for I never saw a book, which pleased me better, and made me more wonder.” Over the course of his 1615 visit, and another the following summer, Briggs worked with Napier to redefine the logarithm according to Brigg’s notions, which they reintroduced as “The Common Logarithm”.
Napier died only two years later, in April of 1617. That same year, Briggs published his first chiliad (meaning 1000, from the greek chilioi) of newly calculated common logarithms to 14 decimal places. He would go on to publish another volume of 30,000 logarithms in 1624.
>>> log10(3945756)
6.596130225586733 # <0.1s
Logarithms are a wonderful example of two ideas: transforms and the time/space tradeoff.
The tables of logarithms illustrate time/space beautifully. Once Briggs and Napier had paid the (enormous) one-time cost of tabulating logarithms by hand, every subsequent user of the tables could trade a small amount of space (a heavy book) for a huge amount of time (turning multiplication into addition):
Start from the defining property of the logarithm base : it is the inverse of exponentiation,
Take two numbers and , and consider their product . Write each in exponential form using base :
Multiplying these together and using the law of exponents :
Taking of both sides and using that and undo each other:
Every multiplication in the tables’ era became a table lookup plus an addition — the whole point of the exercise.
The chart below shows why this mattered so much for hand computation: grows far slower than the quantities it’s applied to, so a table only has to be “tall enough” to cover a huge range of inputs.
Loading chart…