Computers and π (Pi).

I have wondered this now for some time. Why is it, when the build a new computer, and they want to test it out, they calculate Pi (π)?

Pi is not the only irrational number. And it’s not even my favorite.

For starters, I like the square root of 3, believe it or not. Here, I’ll even get them started with the calculator on my computer: 1.7320508075688772935274463415059.

My next favorite irrational number is a little more obscure. In high school, we were taught trigonometry. And it is really a fascinating subject, well, in my opinion at least. And for some reason I was immediately drawn to the Sine of 60 degrees. It equals the square root of three (again) divided by 2. Here, again I will get them started: 0.86602540378443864676372317075294.

I can’t say why I like the Sine of 60. It’s just something about that beginning 8 and then two 6’s. Looks imposing, I think–kind of like the “57” in Heinz “57 Varieties”. Just my personal feelings at least.

Well, those are my two submissions for irrational number for new computers to find. What do the rest of you think?

:):):slight_smile:

There are a few reasons:

  1. Pretty much everyone knows what pi is, so you can use it to easily communicate with them about how powerful your new box is. (We calculated pi to seventy gazillion places in one nanosecond!) Not as many people know about e or have ever really thought about the square roots of two or three.

  2. There’s a chicken-and-egg thing. We’ve been calculating pi since the dawn of digital computing, so every time there’s a new big computer, we check that it works by calculating pi again and comparing it to previous calculations. If the first hundred billion or so digits match, then it probably works. (Although there have in recent times been efforts to calculate other favorite irrational numbers to many digits. But the fact is there’s no real practical purpose for doing this other than testing and for bragging rights.)

  3. There are some interesting algorithms that have been developed for calculating pi, in particular some really cool binary spigot algorithms. I don’t know if such things exist for other interesting numbers.

Instead of decimal notation where √3 = 1.732…, continued fraction notation is purer and many irrational numbers become “boring.” For example, √3 = [1; 1, 2, 1, 2, 1, 2, …].
BTW, √3’s decimal expansion is almost the only √ I’ve memorized and George Washington is the only President whose birth-year I’ve memorized. I learned them together more than five decades ago, the one reminding me of the other and vice versa :slight_smile:

In continued-fraction notation, e = [2; 1, 2, 1, 1, 4, 1, 1, 6, 1, 1, 8, 1, 1, 10, …] but π is the unfathomable(?) π = [3; 7, 15, 1, 292, 1, 1, 1, 2, …]

My favorite irrational is the golden ratio φ = [1; 1, 1, 1, 1, 1, …]. It seems nifty that the Golden-ratio bus-scheduling heuristic relies on two more-or-less unrelated properties of the Golden ratio.

Should they calculate the 5 million names of God ? (Obscure short story, but I assume the title gives the idea.)

Since when do they calculate pi? The first thing we do when we integrate a new processor into a computer is boot UNIX and print “hello world.” If you can boot the OS you are most of the way there. I’ve never seen anyone brag about computing some of pi, which would just test a limited number of instructions and the floating point unit.
Maybe supercomputers do this - but it wouldn’t be much of a test of parallelism in any case.

They do a whole lot of different tests. One of the things they like to do with new computers is generate a bunch of random (pseudo-random) numbers and test them for giveaway patterns.

Also to try to hack the registrar’s office computer and give yourself a better grade in that pesky American Literature class.

The problem with this is that you can only do it once before you notice that “overhead, without any fuss”, the stars are going out.

ETA: Wasn’t it actually the nine billion names of God?

Yes to both. Most of us prefer a test routine that will not end the universe. :smiley:

Do they test out new computers by calculating digits of Pi anymore? I thought that went out with hair bands. Or maybe disco.

I don’t think it was ever in. It’s a really poor test of a CPU. When I build a new computer the first thing I do is look for smoke. After that I’ll do something that involves a lot of memory, or something better than producing what appears to be random digits.

It is one of several informal benchmarks used by people who like to overclock their computers and try and see who has the fastest. As such, it is a measurement of one aspect of a processor/computer system that some people like to compare.

I would be interested to see a cite that identifies any large processor manufacture or computer manufacturer as using PI calculations as a test of a device.

An example of an actual test used to verify a processors functionality is here

That is Intels processor test program, with test meaning “does it actually work as it is supposed to”
“The diagnostic checks for brand identification, verifies the processor operating frequency, tests specific processor features and performs a stress test on the processor.”

I suspect that is mostly for customers. The actual verification of processor functionality is a lot harder than that.

After the FDIV bug Intel poured tons of verification resources on each processor. Most functionality verification is done long before there is any silicon, and consists of manual or automatic tests run on simulators which run on thousands of servers.
(This is all from 15 years ago or so - but I doubt it has changed much except in the addition of more formal verification.)
Since Intel processors are compatible with previous versions, there is a large library of functional verification tests which are run on first silicon. These are called “kitchen sink” tests. You run those and new patterns and see what breaks. Eventually you discover that most of the tests detect nothing and they get pruned.
Then there are still more detailed tests which look for defects, and problems of functionality. These can detect design errors and functionality tests can detect defects, but they are not good at the jobs they are not designed to do.

By the time a customer sees a part the design errors had better be scrubbed, except for a known bug list which won’t be tested by the diag. That is to detect either defects which have popped up, or maybe marginal parts which have drifted to bad territory as they age. I suspect most of it is to make the user feel better.

Agree, the software package linked is more of an integration test making sure the processor is playing well with everything else in the computer, probably should have said ‘verify the computers functionality”, with the caveats that a test only test the tings it is designed to test. I’d put the PI test in a ‘benchmarking ‘ category as it really doesn’t have a pass/fail criteria

On a similar note to your last paragraph about processor testing and design error and bugs , up until about 10 years ago, 8086 and 80186 processors were still being designed into downhole drilling equipment and in other applications where fault tolerance was critical. This was largely because the known bug list and behaviors was very well known and documented, so the people writing the code for the processor would be unlikely to be surprised by an undocumented feature. I think the only reason they were eventually dropped was because getting them in ceramic form factor was almost impossible.

Another reason might be that they are made at a very old process node, which has very high yields. Field failures are a function of inherent yield, so this would also lead them to being more reliable. Government labs doing very high reliability stuff also use old process nodes, as well as doing tests that we in industry could never afford.

The test I’ve usually seen used is Prime95, which finds prime numbers, not the value of Pi.

As for favorite irrationals, my obvious choice is Euler’s number e=2.718281828459045… I use it much more often than I do pi, and it has a long repeated sequence early in the decimal expansion, such that if you can learn the first 5 decimal places you get the next 4 for free.

Still pi is the Elvis of the transcendentals, and I admit knowing the first 30 decimal places of pi from memory while only knowing the first 9 decimal places of e.

Arthur C. Clarke short story?
9 Billion

Now-a-days that would take a dozen nanoseconds on a iPhone? :dubious:
G!
…and one by one, without a fuss, the stars began to wink out.

ETA: Ninja’d by Dervorin :frowning: