Science and Engineering: Innovation, Research, Education and Economics
October 17, 2008
Problems Programming Math

Arithmetic Is Hard - To Get Right by Mark Sofroniou

I’ve been working on arithmetic in Mathematica for more than 12 years. You might think that’s silly; after all, how hard can arithmetic be?

The standard “schoolbook” algorithms are pretty easy. But they’re inefficient and often unnecessarily inaccurate. So people like me have done a huge amount of work to find algorithms that are more efficient and accurate. And the problem is that these algorithms are inevitably more complicated, and one has to be very careful to avoid insidious bugs.

Take multiplying integers, for example. The standard “schoolbook” long-multiplication algorithm uses n^2 multiplications to multiply two n-digit numbers. But many of these multiplications are actually redundant, and we now know clever algorithms that take n^1.58, n log n, or even fewer multiplications for large n. So this means that if one wants to do a million-digit multiplication, Mathematica can do it in a fraction of a second using these algorithms–while it would take at least a few minutes using standard long multiplication.

It’s not easy to get reliable numerical computation, and it’s not something one can “bolt on” after the fact. It’s something one has to build in from the beginning, as we’ve done in Mathematica for nearly 20 years.

Related: Who Killed the Software Engineer? - Sexy Math - Freeware Math Programs - 1=2: A Proof - Things You Need to be a Computer Game Programmer

Leave a Reply

Curious Cat Science and Engineering Blog © curiouscat.com 2005-2008 powered by WordPress
Curious Cat Alumni Connections

Internal Links

Author

 

John Hunter

Categories

Other

Search Blog

Web Search

Science and Engineering web search

Archives

October 2008
M T W T F S S
« Sep   Nov »
 12345
6789101112
13141516171819
20212223242526
2728293031