HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

If $\log xy=\log x+\log y$ then why multiplication is harder than addition?

Submitted by: @import:stackexchange-cs··
0
Viewed 0 times
whymultiplicationlogthanadditionharderthen

Problem

Someone told me that the $\log$ function was introduced to make the calculation easier. If we have to calculate $xy$, we can calculate instead $\log x+\log y$ since $\log xy=\log x+\log y$. How this can make the calculation easier? Maybe from a mathematician point of view but what about a computer scientist's point of view?

If it makes the calcualtion easier then why people do not use it to simplify the complexity of the multiplication algorithms?

From my own thinking, this transformation makes the calculation more difficult. How can we calculate the $\log x$ and $\exp x$ functions in a computer?

Am I right? Any suggestions please? Thank you for your time.

Solution

Logarithms were used to make computation easier at a time when computers were not available. Even in the twentieth century, when mechanical machines became available to do arithmetics with much precision, they remained so expensive, and often cumbersome, that most people did not use them. The mechanical hand held calculator doing the four arithmetic operations did not appears before the end of the second world war
(this machine, called the Curta, was actually designed in a concentration camp, which saved some lives).
Since most calculations did not require too much precision, many people simply used slide rules, or tables of logarithms. The typical cartoon of a scientist or engineer whould show him with the slide rule in his front pocket.

I am old enough that I did not have hand calculators at school (computers still used more space than my classroom). What I
had was a slide-rule, which is based on logarithms. It did not give a
very high precision (at best something like $10^3$, i.e., 3 decimal digits),
but it was invaluable to do problems in physics. Numbers were read
directly on the slide rule, that essentially can add lengths.

For more précision, we would use tables stored in books. That gave 4
digits, plus one with interpolation (as I recall). We also has direct
table for logarithms of trigonometric functions.

This was well organized, and the cost of computing logs and
exponentials with the tables was nothing compared to the savings of
not doing multiplications by hand. It was actually free, with direct
reading of graduations, on the slide-rule.

This was not a mathematician viewpoint, but a physicist viewpoint,
or that of any person having to do much calculation involving
multiplications, such as astronomers, or people mapping the land
(which probably took several centuries).

I did not check, but I would guess that numerical algorithmic design
at the time must have been much influenced by the idea of minimizing
translation to and from logarithms. I would guess we were told in class to be careful about that.

Considerable effort was also spend in building very precise tables. By
hand, of course, at least until mechanical arithmetic machines became available. According to wikipedia, despite a large number of earlier prototypes, the calculator industry did not start before the middle of the 19th century.

This all started with the invention of logarithm by John Napier at the
beginning of the seventeenth century. His contact with astronomer
Tycho Brahe who was at the time mapping very accurately the motion of
celestial bodies (so that Kepler and Newton would have the data for
the work that made them famous), and other such person, may not have
been foreign to his invention of this most remarkable computation
tool.

The fact that logarithms can make multiplication easy was certainly
one very important factor in the development of science and
technology for nearly 3 centuries.
But not knowing exactly who used it and when, I cannot make a more
precise statement.

Context

StackExchange Computer Science Q#23554, answer score: 6

Revisions (0)

No revisions yet.