Back to Elevators, toasters, and the birth of Java.
Why Did Intel Use the Wrong Pi?
James Gosling says Intel used an incorrect version of pi for sine and cosine because of an early launch and restrictions on what silicon could do at the time.
Sine and cosine repeat, so only the span from negative pi to positive pi makes a difference once an angle is larger. Range reduction folds the angle back in by taking the angle modulo 2 pi, and Intel's pi for that step was slightly wrong. In the numerical analysis community, a rotating shaft in a motor or a propeller on an airplane turns RPM times time into an angle, and the result is the sine and cosine of a very large angle.
The mistake looks like a minor nit. The day starts with issues people have moving software across wildly different proprietary platforms, and the work turns into a deep dive on how sine and cosine are evaluated.
Elevators, toasters, and the birth of Java ·
From the transcript
Unfortunately, what it meant for Intel was that because they have like a lot of backward compatibility, their old style rounding and then there's the consistent rounding. One of the other kind of odd things that happened was that in the evaluation of sine and cosine, there's this process called range reduction because only from plus or minus pi makes any difference if you're larger than that.
It's a function that repeats. And so range reduction gets it in. Because Intel's early launch and some restrictions on what you could do with silicon that time, they used an incorrect version of pi. Because you have to take the angle mod 2 pi. And they had a slightly incorrect version of pi. And that numerical analysis community, if you're doing something like a rotating shaft in a motor or a prop on an airplane, and you take RPM times time, and then you try to convert that into an angle, you end up doing like a sine and a cosine of a very large angle.