Slashdot Mirror


How Many Digits of Pi Does NASA Use? (kottke.org)

An anonymous reader quotes an article on Kottke.org: Mathematicians have calculated pi out to more than 13 trillion decimal places, a calculation that took 208 days. NASA's Marc Rayman explains that in order to send out probes and slingshot them accurately throughout the solar system, NASA needs to use only 15 decimal places. Rayman explains, "The most distant spacecraft from Earth is Voyager 1. It is about 12.5 billion miles away. Let's say we have a circle with a radius of exactly that size (or 25 billion miles in diameter) and we want to calculate the circumference, which is pi times the radius times 2. Using pi rounded to the 15th decimal, as I gave above, that comes out to a little more than 78 billion miles. We don't need to be concerned here with exactly what the value is (you can multiply it out if you like) but rather what the error in the value is by not using more digits of pi. In other words, by cutting pi off at the 15th decimal point, we would calculate a circumference for that circle that is very slightly off. It turns out that our calculated circumference of the 25 billion mile diameter circle would be wrong by 1.5 inches. Think about that. We have a circle more than 78 billion miles around, and our calculation of that distance would be off by perhaps less than the length of your little finger."

98 of 174 comments (clear)

  1. How many digits to use by Z00L00K · · Score: 1, Insightful

    How many digits to use depends on the application. For a satellite trajectory the 15th decimal is OK, but if you want to make a sharp mirror the precision in the calculation have to be higher.

    --
    If builders built buildings the way programmers wrote programs, then the first woodpecker would destroy civilization.
    1. Re:How many digits to use by Anonymous Coward · · Score: 5, Insightful

      How many digits to use depends on the application. For a satellite trajectory the 15th decimal is OK, but if you want to make a sharp mirror the precision in the calculation have to be higher.

      Err, no. The radius of a proton is around 10^-15 meters. Atoms are 10.000 times larger than that. Visible light is around 5 * 10^-7 m, depending on color. Polishing a mirror at 10^-15 accuracy would be physically impossible and pointless.

    2. Re:How many digits to use by ledow · · Score: 1

      And moot in the face of:

      - Not knowing the exact centre of mass of the planet in question to the same accuracy.
      - Not knowing the altitude, density, etc. making up the planet to the same accuracy.
      - Not knowing the warp-effects of space and nearby objects (i.e. everything with mass) to the same accuracy.

      Which is why we aim it "good enough", and then put 10% more fuel than strictly necessary into it, even if that's at ENORMOUS cost.

      Hell, when GPS was launched, the US military still wasn't convinced that Einstein was right so they included an option NOT to compensate for relativity in their calculations. That's how "accurate" we need to be.

      Pretty much, worry about the thing to which you can measure least accurately, and then made sure you add on enough backup to compensate for all your estimated error margins - plus a bit more. And then you won't need to worry.

      But, yes, I know pi to 32 decimal places. It's a singularly useless skill except to keep your mind elastic. I actually ended up memorising it because I was writing different programs in school that approximated pi and it's hard to know when they are converging quickly or not, and after a while you get to memorise the number you keep referring to.

    3. Re:How many digits to use by rgmoore · · Score: 3, Informative

      I don't think so. The normal standard for a mirror is 1/4 the wavelength of the light it's supposed to be reflecting, or around 100 nm. Even ultra-high precision mirrors like the ones on the Hubble Space Telescope are only ground to within about 10 nm. A 10 nm error on a mirror 100m in diameter- far larger than any mirror currently under construction- is still only 1 part in 10^10, far lower precision than what you're talking about. Unless you're building a mirror the size of a planet, you aren't going to need more than 15 digits of precision.

      --

      There's no point in questioning authority if you aren't going to listen to the answers.

    4. Re:How many digits to use by hankwang · · Score: 4, Informative

      if you want to make a sharp mirror the precision in the calculation have to be higher.

      How so? For high-precision applications, you'd typically want a mirror with a deviation from its calculated surface that is better than lambda/20. For UV light at 200 nm and a mirror size of 1 m, that would be about 8 significant digits to describe the surface. Then you have 7 more digits to deal with intermediate results during the calculation.

      Note: For X-ray mirrors, the wavelength is much shorter, but because X-ray mirrors are grazing-incidence mirrors, the surface tolerance is more like lambda/1 - - which also boils down to about 8 significant digits. Anyway, to describe the surface with an accuracy down to the size of an atom, you still only need 10 significant digits.

    5. Re:How many digits to use by fizzup · · Score: 3, Informative

      I can't think of a step in the process of making focusing mirrors that requires a decimal expansion of pi more accurate than 3.14 (an error of 0.05%).

      The only step that I can think of that needs a decimal expansion at all is to estimate how deep you need to hog out the material at the roughest formation (i.e., estimating the saggita). That estimation doesn't need better tolerance than 0.1%.

      The spec on the focal length probably has a tolerance of 1% or 0.1% since nearly every device has an adjustable instrument/detector platform to refocus. You could measure the actual focal length of any mirror more accurately than 0.1%; however, it barely matters because I can't think of any use for pi in performing the measurement.

      I can't think of any mirror test in use that requires a decimal expansion of pi: not Ronchi, not Foucault, not interferometry.

      Honestly, the only exception I can think of is a spin cast mirror, which probably needs an accurate rotational speed on the platter. It may not, though - spin casting is only used to rough out the shape. Maybe it's better than 0.1% and maybe not (it's definitely not one part in a quadrillion, though). The LZT liquid mirror uses closed loop control to fix the rotational speed to within one part in a million but I think it just needs to be constant, rather than precise, so that the focal length doesn't change during an observation and so eddy currents aren't set up in the mirror surface. For all I know they adjust the focus by changing the rotational speed of the platter so an accurate expansion for pi doesn't even enter into it at all. It's possible that slashdot has not yet devolved into a such a pit of misinformation that one of the star nerds that works on the LZT will read this and chime in. Probably not.

    6. Re:How many digits to use by bazmonkey · · Score: 1

      I don't think this makes as much sense as you think it does.

    7. Re:How many digits to use by Anonymous Coward · · Score: 1

      The answer would depend on what is inside the circle. If you have a super-massive black hole in the middle, then the circumference is going to be less than one might expect from the diameter. Space distortion and stuff being the cause.

    8. Re:How many digits to use by fizzup · · Score: 1

      Replying to my own comment because I realized you don't need pi to calculate the sagitta while I was walking the dog!


      s = r - sqrt(r*r - (d/2)*(d/2))

      where s is the sagitta, r is the radius of curvature of the mirror, and d is the diameter of the mirror. I think that the only time you use pi to create a mirror is if you spin cast it.

    9. Re:How many digits to use by djl4570 · · Score: 1

      The precision of the calculation can only be as good as the precision of the measurements. With mirrors and lenses we can use interference patterns to measure differences on the order of a wavelength of light. With spacecraft we can make some impressive measurements of velocity, mass, acceleration position using inertial guidance but that is at some level a mechanical measurement. Back to the mirror. Sixteen significant digits of Pi is 3.141592653589793 which should be adequate for calculations involving light which has wavelengths of 400nm to 700nm or .000 (milli) 000 (micro) 400 (nano) nnn (pico) nnn (femto) which gets you out to fifteen significant digits. BTW I once told some managers I worked for:. "If builders built buildings the way analysts design systems, the first woodpecker would destroy civilization." This was after a spec was delivered two months late and they somehow blamed the developers for being two months behind and using up all of the slack in the schedule.

    10. Re:How many digits to use by niftymitch · · Score: 1

      How many digits to use depends on the application. For a satellite trajectory the 15th decimal is OK, but if you want to make a sharp mirror the precision in the calculation have to be higher.

      Because of floating point format limits mostly NASA would use PI thus
            #include math.h
      Something like...

      $ grep PI ....../usr/include/math.h ......
      #define M_PI 3.14159265358979323846264338327950288 /* pi */
      #define M_PI_2 1.57079632679489661923132169163975144 ....

      It is rare that more digits are used. The troubles are in transcendental functions computed
      as series (Taylor) in math.a/math.so and friends. There is a lot of work on this but has
      little to do with PI in the details.

      --
      Truth is stranger than fiction, but it is because Fiction is obliged to stick to possibilities; Truth isn't. Mark Twain.
    11. Re: How many digits to use by jeremyp · · Score: 1

      Except some are saying pi is not quite fully random

      It's not random at all. I calculated the first few digits a hundred times yesterday and each time the sequence started out 3 1 4 1 5 9 2.

      And perhaps to g-d it is an integer. After all she gave us an infinity of counting numbers. What was held back? Smile.

      The infinity of counting numbers is too small to count all the real numbers.

      --
      All I want is a secure system where it's easy to do anything I want. Is that too much to ask ~~ Randall Munroe
    12. Re:How many digits to use by RockDoctor · · Score: 1

      Even ultra-high precision mirrors like the ones on the Hubble Space Telescope are only ground to within about 10 nm.

      And a contributing factor to going to that precision is the need to accommodate potential new (at the time of design) UV sensors.

      --
      Birds are not dinosaur descendants;birds are dinosaurs, for all useful meanings of "birds", "are" and "dinosaurs"
  2. M_PI by ShanghaiBill · · Score: 3, Informative

    I just use M_PI which is defined in math.h:

    #define M_PI 3.14159265358979323846264338327950288

    The symbolic constant is easier than typing in 15 digits, and the compiler recognizes the constant and optimizes it to use the hardware constant built in to the FPU, so I get faster execution as well.

    1. Re:M_PI by Citizen+of+Earth · · Score: 1

      Moreover, double-precision floating point can make use of up to 17 digits of the M_PI definition, so NASA should be using 17 digits instead of 15 just to avoid needless differences in results on standard hardware.

    2. Re:M_PI by ShanghaiBill · · Score: 5, Insightful

      Duh... What?!? Reference, please??? What hardware constant built into the FPU?

      Pi is built in to x86s. You can load it into a register with the FLDPI instruction. It is built in to many other processors as well. Using it will give you the maximum precision, and will be faster to execute since it uses less bandwidth and cache.

    3. Re:M_PI by slashping · · Score: 1

      If you're worried about the memory bandwidth to load pi, you're either an embedded developer, and not on an x86, or quite possibly just a pain in the ass to be around.

      Or you're somebody trying to maximize the number of floating point operations involving PI.

    4. Re:M_PI by orledrat · · Score: 1

      Yeah, but I could count those people with one hand.

      I mean, I could if I'd count on my phone's FPU to do the aritmethic, he knows IEEE754 like the back of his hand.

    5. Re:M_PI by delt0r · · Score: 1

      His point from the poorly worded summary is that there are far bigger errors. So it really doesn't matter.

      --
      If information wants to be free, why does my internet connection cost so much?
    6. Re:M_PI by Aighearach · · Score: 1

      just to avoid needless differences in results on standard hardware.

      That might not be a value that NASA shares. :) They might only care about results on explicitly defined hardware.

    7. Re:M_PI by complete+loony · · Score: 1

      It's a rematerialisable constant. In a tight loop under register pressure, the compiler might choose to keep reloading the value into a register. Shrinking the op code may mean that the code of the entire loop fits into a cache line....

      Compiler engineers certainly do think about these things. Even if most developers don't care as much, there's a HPC project somewhere with someone employed to worry about these kinds of problems. Plus it might allow them to get better performance numbers on a specific benchmark.

      --
      09F91102 no, 455FE104 nope, F190A1E8 uh-uh, 7A5F8A09 that's not it, C87294CE no. Ah! 452F6E403CDF10714E41DFAA257D313F.
    8. Re:M_PI by KingMotley · · Score: 1

      That's great, but tau is double pi (6.28...) not half pi (1.57...).

  3. Re:And those Republicans keep... by belthize · · Score: 1

    Probably because given a standard pie's radius (around 6 inches) then using 3 provides a circumference which is accurate to roughly 1.5".

    So they read NASA's paper, understood precision but got a little confused about Pi vs pie.

  4. 39 digits by J'raxis · · Score: 5, Informative

    And similarly, 39 digits of pi will let you calculate a sphere the size of the observable universe with an error the width of a single hydrogen atom.

    1. Re:39 digits by AthanasiusKircher · · Score: 4, Insightful

      I don't know why any of these "numbers of digits" things are surprising to anyone.

      When you calculate a circumference, for example, you're just multiplying pi by some other number. You're not going to need more precision in pi than you have in the number of orders of magnitude of precision in the other number.

      So, all of these discussions about "how many digits of pi" actually just are asking "how many order of magnitude" of length or whatever are in various sizes/comparisons within the universe.

      It's really not necessary to bring pi into this discussion at all. It's just talking about precision of measurement and orders of magnitude in general.

      It seems to me that these answer would only be interesting/surprising to those who have no understanding of "significant figures" in calculations. (Unfortunately, that seems to apply to most people and students, who will assume that however many digits their calculator or whatever spits out are meaningful.)

    2. Re:39 digits by belthize · · Score: 1

      Which is proof against intelligent design or at least evidence that God's not a programmer. Why type pi as an infinite float when a double precision would work. Wildly inefficient and slows the simulation down from infinitely fast to infinitely fast minus a bit.

    3. Re:39 digits by slashping · · Score: 1

      God uses octuple precision, you insensitive clod.

    4. Re:39 digits by thegarbz · · Score: 1

      I don't know why any of these "numbers of digits" things are surprising to anyone.

      Because quite frankly education is quite lacking and people don't really get exponents of decimal places any more.

    5. Re:39 digits by skastrik · · Score: 1

      39 digits of pi will let you calculate a sphere the size of the observable universe with an error the width of a single hydrogen atom.

      42 digits should have sufficed for God during Creation then.

    6. Re:39 digits by AthanasiusKircher · · Score: 1

      Any more? Ask a 70 year old that didn't have an engineering or science career to calculate exponents of decimal places. They will look at you like you are crazy.

      That may be true. But my experience with quite a few older folks is that they tend to understand estimation for basic arithmetic rather well. If they have any mental math skills (and many of them do, even if it's mostly basic arithmetic), they can often estimate things to get at least the order of magnitude and the first digit about right.

      That's much more than I've seen for most people under the age of 40, who seem lost without some device to calculate for them -- and who will happily believe that device when it spits out a random number off by a number of orders of magnitude (usually due to an entry error) followed by 10 or more completely insignificant digits.

    7. Re:39 digits by Imbrondir · · Score: 1

      42 digits should be enough for anyone ;)

    8. Re:39 digits by thegarbz · · Score: 1

      and who will happily believe that device when it spits out a random number off by a number of orders of magnitude (usually due to an entry error) followed by 10 or more completely insignificant digits.

      Indeed. I have a funny story I love telling about this. Was supervising a graduate engineer on an oil refinery size and install a flow meter based on differential pressure across an orifice (cheap, horrible turn down, accuracy 5% on a good day). The result installation was precision calculated. She estimated the with the maximum pressure through the orifice there would be something like 63156.83 kg/h of flow through the line.

      A week later he said he got complaints from operators after it was installed that the numbers appeared to be bouncing around in the order of +/- 100L/h and he asked me to help. He was dumbfounded when he came in the next day and saw the instrument ranged from 0-63 T/h without any decimals on display. He complained that it would throw out the math and I had to explain to him the unimportance of exact math when it comes to reading something that's only 5% accurate in the first place.

    9. Re:39 digits by qzzpjs · · Score: 1

      42 digits should have sufficed for God during Creation then.

      God only needed 1 digit since he probably used PI as his base numbering system instead of 10.

    10. Re:39 digits by tlhIngan · · Score: 1

      I don't know why any of these "numbers of digits" things are surprising to anyone.

      When you calculate a circumference, for example, you're just multiplying pi by some other number. You're not going to need more precision in pi than you have in the number of orders of magnitude of precision in the other number.

      So, all of these discussions about "how many digits of pi" actually just are asking "how many order of magnitude" of length or whatever are in various sizes/comparisons within the universe.

      It's really not necessary to bring pi into this discussion at all. It's just talking about precision of measurement and orders of magnitude in general.

      Well, we know Pi to 133T digits. How many of those are useful to us now, on a practical sense. The answer, is 39, at which point the error boils down to half an hydrogen atom, when using the size of the observable universe as a guide.

      Knowing how many practical digits of Pi means even on Earth-sized values, we can use a lot less digits and pretty much call it an exact, practical constant whose error is so small you're going to encounter quantum effects.

      Yes, you can talk about significant figures and all that, but Pi can be treated as a constant - and like all constants, be of infinite precision and thus not affecting the significant figure count at all. Even though Pi is irrational, for practical purposes 39 digits will be all you need. Or given human sized items, probably far less digits - what, maybe 20 before even the error of Earth is within a Planck length?

      Sure you'll never have that many sigfigs, but heck, even if you're doing a theoretical calculation, you only need to add a few more digits to ensure that your Pi approximation won't be the cause of errors in your simulations.

    11. Re:39 digits by vovin · · Score: 1

      You see there only are 42 digits ... we just make the rest of them up as we go along :P

    12. Re:39 digits by Hognoxious · · Score: 1

      Ask anyone under 40 what exponents *are* and you'll get a similar result.

      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
    13. Re:39 digits by Hognoxious · · Score: 1

      If you're doing a theoretical calculation wouldn't you just leave it as a symbol like you do with surds?

      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
    14. Re: 39 digits by pgn674 · · Score: 1

      And for an error to one plank length, you need 62.

    15. Re:39 digits by david_thornley · · Score: 1

      How well does this apply to the actual observable Universe? It's got mass and energy in it, which means it isn't actually flat, so the circumference will be at least a touch less than you'd get from multiplying the diameter by pi.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    16. Re:39 digits by tlhIngan · · Score: 1

      If you're doing a theoretical calculation wouldn't you just leave it as a symbol like you do with surds?

      Only works if you can keep it symbolic. Far too many things are too hard to do symbolically so they do the calculations numerically.

  5. so, the exact precision of double floating points by coolsnowmen · · Score: 3, Informative

    https://en.wikipedia.org/wiki/Double-precision_floating-point_format

    "This gives 15–17 significant decimal digits precision. If a decimal string with at most 15 significant digits is converted to IEEE 754 double precision representation and then converted back to a string with the same number of significant digits, then the final string should match the original. If an IEEE 754 double precision is converted to a decimal string with at least 17 significant digits and then converted back to double, then the final number must match the original.[1]"

  6. 15decimal places - how convenient ... by Alain+Williams · · Score: 4, Insightful

    The NASA computers will be using IEEE 754 floating point format, which in 64 bits (double precision) yields about 16 decimal digits of precision. So: what came first, NASA deciding that 1.5 inches the needed accuracy in the solar system or their computers being that accurate being deemed an acceptable accuracy ?

    1. Re:15decimal places - how convenient ... by slashping · · Score: 1

      I guess the computer format came first, and then NASA said: "yeah, that's good enough".

    2. Re:15decimal places - how convenient ... by cyn1c77 · · Score: 1

      The NASA computers will be using IEEE 754 floating point format, which in 64 bits (double precision) yields about 16 decimal digits of precision. So: what came first, NASA deciding that 1.5 inches the needed accuracy in the solar system or their computers being that accurate being deemed an acceptable accuracy ?

      The number of digits of precision was decided on in 1990: http://fits.gsfc.nasa.gov/fp89...

      Also, your question is poorly posed. The number of digits is not dimensional. Physical accuracy is dimensional. Additionally, use of math and physics to constrain a problem analytically before solving numerically makes it possible to achieve higher levels of precision to the end user than would be achieved with a brute force direct calculation, like that discussed in the example.

      Normally, this would have been common knowledge on /. But maybe the use of graphing calculators in school has eradicated these concepts from the younger population?

  7. Re:And those Republicans keep... by toonces33 · · Score: 1

    I am no fan of Republicans, and while there was an element of truthiness in the article you cited, in fact the article was satire.

  8. Planck length by Sqreater · · Score: 4, Interesting

    How many digits would it take of PI to bring the error down to the Planck length? Anything smaller in any measure of distance would be meaningless.

    --
    E Proelio Veritas.
    1. Re:Planck length by Sqreater · · Score: 1

      In such a case, PI would be a measure of distance. PI to 13 trillion places is like saying a universe of 13 trillion PI places diameter.

      --
      E Proelio Veritas.
    2. Re:Planck length by Sqreater · · Score: 1

      Infinite PI then represents "possibility" if not actuality.

      --
      E Proelio Veritas.
    3. Re:Planck length by Sqreater · · Score: 1

      But then, where does "possibility" come from? Where did the "possibility" of a big bang come from? There seems to be something "outside." (Not a religious comment.)

      --
      E Proelio Veritas.
    4. Re:Planck length by wonkey_monkey · · Score: 4, Insightful

      Mmm, infinite pie.

      --
      systemd is Roko's Basilisk.
    5. Re:Planck length by thegarbz · · Score: 1

      46.

      At a scale of 40e9 meters * 3 you get 120e9 or 1.2e11. Each digit beyond the decimal reduces that order of magnitude of the error. 11 decimals gets you to a 1m precision. Planks length is 1.6e-35 so you need 46 significant digits after the decimal to make your answer .... insignificant :)

      Side note the math in the article is wrong by a few orders of magnitude.

    6. Re: Planck length by Sqreater · · Score: 1

      Or dumb, not to be polite with myself.

      --
      E Proelio Veritas.
  9. Not so simple by Waffle+Iron · · Score: 4, Insightful

    If you plug that number into an iterative algorithm that uses any ill-conditioned functions, the 1.5-inch error can grow exponentially at every step. Ensuring that computations have acceptable error margins is an extremely complex and tricky subject.

    1. Re:Not so simple by iggymanz · · Score: 1

      You imagine NASA has that problem for their numerical orbital solutions? no they don't.

    2. Re:Not so simple by slashping · · Score: 2

      You imagine NASA has that problem for their numerical orbital solutions? no they don't.

      I imagine that they do. Everybody who does complex floating point jobs has this problem. I also imagine that they've solved it.

    3. Re:Not so simple by Waffle+Iron · · Score: 1

      You imagine ...

      No, I didn't.

    4. Re:Not so simple by BitterOak · · Score: 4, Informative

      If you plug that number into an iterative algorithm that uses any ill-conditioned functions, the 1.5-inch error can grow exponentially at every step. Ensuring that computations have acceptable error margins is an extremely complex and tricky subject.

      Orbital motions can be calculated in ways that don't suffer from these problems. Use of quaternion (or equivalent) methods for rotations in 3 dimensional space rather than traditional Euler angles leads to much more stable numerical results.

      --
      If I can be modded down for being a troll, can I be modded up for being an orc, or a balrog?
    5. Re:Not so simple by thegarbz · · Score: 1

      Not a problem since 15 decimal places in pi over a 25billion mile diameter gives you an error of 1.47thou, not 1.5 inches.

    6. Re:Not so simple by iggymanz · · Score: 1

      as someone who did orbital mechanics for thesis, let me tell you the sad news that you are ignorant. In fact, pi needn't even be explicitly used at all for calculating trajectories of body in orbit or changing orbits. Instead pi will come up in the question of time, e.g. when to do something or period of orbit. And 16 digits not needed.

    7. Re:Not so simple by Waffle+Iron · · Score: 1

      WTF do you keep assuming I said?

      The topic was going on and on on how great 15 digits of PI is. I pointed out how it would be bad to just assume that therefore you can put pi (or any other number) in a double-precision variable everything will be just peachy for real-world computations.

      I didn't say that 15 digits is insufficient, only that you have to be very careful about precision in general. There are plenty of algorithms where using the "obvious" implementation will cause double-precision values to blow up. I am well aware that if you restructure those to avoid ill-conditioned functions, you can usually avoid the problems.

  10. Miles and inches? by Anonyme+Connard · · Score: 1, Insightful

    Maybe using SI units rather than neolithic ones would be more important than the number of digits of pi for NASA.

  11. Re:78 billion miles is nothing by Dogtanian · · Score: 5, Funny

    78 billion miles is nothing when it comes to the universe.

    You're saying that it's still in the same ballpark as a trip down the road to the chemist, then?

    --
    "Slashdot - News and Chat Sites Deviant". (Click "homepage" link above for details).
  12. All physical constants are known much less accurat by fizzup · · Score: 2

    G, for example, is only known to 6.67408(31)e-11. I can't think of a single physical constant with a relative standard uncertainty smaller than 1e-10, so using 15 digits of Pi is at least three our four more digits than they need for real-universe calculations.

  13. Re:All physical constants are known much less accu by slashping · · Score: 4, Interesting

    The Rydberg constant is known to 14 decimal places, but I don't think it's very relevant for NASA calculations. https://en.wikipedia.org/wiki/...

  14. 15 significant digits not good enough for me. by 140Mandak262Jamuna · · Score: 1
    The summary confuses decimal places with significant digits. Let it slide, they mean 15 significant decimal digits or 64 bit accuracy.

    The truncation error in cutting PI to 64 bits comes out to 1.5 inches out of 78 billion miles. But that is not how one decides whether 64 bits are good enough or not.

    Each numerical operation will degrade the least significant bit. As you use result of one calc for the next you lose one more bit. If the final result you are looking for is the result of 10 operations, you could lose as much as one decimal digit in accuracy. If I have a 1 million unknowns and even if I somehow invert the million by million matrix and compute the solution in one pass, the last unknown will be only 3 significant decimal digits accurate. Usually we would use iterative methods to improve the accuracy to some seven or eight decimal digits.

    Another important source of these errors is cancellation of terms. In math, a * B / B = a, no matter how big B is relative to A. In numerical computation if you add a large number and then subtract the large number, you would lose so many digits of accuracy. Similar thing happens when you multiply and then divide by a large number.

    My work has not something monumental like calculating the orbits of spacecraft. Among the rocket scientists the lower echelons are made up of people like me, who toil, making a living by calculating intersections of triangles with tetrahedrons, the mesh makers, the grid generators. My code will drop down to using 128 bit or even 256 bit accurate calculations when necessary. It is insane when you think about it. One inch out of 78 billion miles? I am at one electron mass out of the mass of this galaxy! And... if the solution does not converge the first they blame is the mesh maker!

    --
    sed -e 's/Chuck Norris/Rajnikant/g' joke > fact
    1. Re:15 significant digits not good enough for me. by gnasher719 · · Score: 1

      Another important source of these errors is cancellation of terms. In math, a * B / B = a, no matter how big B is relative to A. In numerical computation if you add a large number and then subtract the large number, you would lose so many digits of accuracy. Similar thing happens when you multiply and then divide by a large number.

      Not so, unless an intermediate result overflows and underflows. Without overflow or underflow, calculating c = (a * b) / b may give a result slightly different from a, with a small relative error, but then calculating (c * b) / b actually gives c again. Same for c = (a / b) * b and (c / b) * b.

      With addition and subtraction, the error is small compared to the maximum of a and b.

    2. Re:15 significant digits not good enough for me. by 140Mandak262Jamuna · · Score: 1
      Without overflow or underflow? That is a big assumption to make. Once you make such qualification, it degenerates to "no true scottsman", if everyone has a job there will be no employment ...

      The function that calculates the intersection between two line segments could not make such assumptions. One could estimate the numerical error in the final result and recalculate it with 128 bit or 256 bit precision. Or one could try to predict when it would be needed by looking at some determinant. At some point it is more engineering hacks rather than strict mathematics. 128 bit calculations would be 10 times slower than 64 bit and 256 bits will be 100 times slower if implemented in software using highly portable but unoptimized functions ( qd lib I am looking at you). There are much faster implementations that will take two or four adjacent registers and use bit shifts to make it much faster. But it would be a pain to get them working cleanly. There are infinite precision arithmetic modules available. But they too are very expensive.

      --
      sed -e 's/Chuck Norris/Rajnikant/g' joke > fact
  15. How much difference does relativity make? by wonkey_monkey · · Score: 1

    How much difference does general relativity make when measuring the solar system?

    If the Sun and all the planets were removed, would the distance between where the Sun was and where Voyager is change?

    --
    systemd is Roko's Basilisk.
  16. Gangster by The+Nipponese · · Score: 1

    If only there was a way to make a "Thug Life" youtube video out of a ./ post.

  17. What about double precision? by gnasher719 · · Score: 2

    Double precision numbers use a 53 bit mantissa. For the number pi â 3.14 the last bit of the mantissa has a value of 2^-51. Any real number between 2 and 4 can be represented with an error less than 2^-52.

    At a radius of 12.5 billion miles, the error in calculating the product times pi before rounding would less than 12.5 billion miles times 2^-52 times 2, which is 0.352 inches or 8.94 mm.

    The result in miles is about 78 billion, somehow bigger than 2^36. The rounding error would be up to 2^-17 miles or 0.483 inches or 12.3 mm. So the bounds for the rounding error alone is already higher than the bounds due to the error in pi.

  18. Whose finger? by JustAnotherOldGuy · · Score: 1

    "...our calculation of that distance would be off by perhaps less than the length of your little finger."

    Or, by another measure, twice as long as Donald Trump's middle finger.

    --
    Just cruising through this digital world at 33 1/3 rpm...
  19. Re:78 billion miles is nothing by kimvette · · Score: 1

    The long road down to the chemist is just peanuts to space. Space is vastly, hugely, mindbogglingly big.

    --
    The Christian Right is Neither (Christian nor right). See: Matthew 23, Matthew 25, Ezekiel 16:48-50
  20. Re:so, the exact precision of double floating poin by Solandri · · Score: 4, Informative

    Posting because I've seen too many programmers misunderstand this and screw things up when using floats. This does not mean you can do whatever you want with floats and your accuracy will be at least 1.5 inches within a 25 billion mile radius. It means an individual double float number has a precision of 17 significant figures, nothing more. When you start doing math with that number, the precision can quickly go out the window.

    For example, if you add a large float to a small float, say 3.14159265359x10^8 + 2.7182818284x10^-3, the latter number doesn't actually matter because it's largest digit is smaller than the uncertainty (the last significant figure) in the first number. In other words, floating point's accuracy decreases the further you get from zero. A solar system modeled with ints will have the same resolution everywhere, which is how people want to think significant figures work. But a solar system modeled with double floats will have very fine resolution close to the origin, lousy resolution out near the edges.

    To do this sort of math accurately using float (e.g. calculating docking coordinates for two spacecraft orbiting Jupiter), you are better off first doing a coordinate transform to center your zero closer to where everything is happening, do your math, then transform the results back to your original coordinates (or keep them in your new coordinate system if you plan to do more math there later). Obviously that's a pointless exercise with this simplified math problem, but it can make a big difference in accuracy with more complex math.

    For a real-world example, we once networked two flight simulators together and tried to make them fly in formation. The position of the second plane appeared to jump all over the place when viewed from the first plane, and vice versa. What was happening was our coordinate system was fixed to the Earth. Planes fly on the order of 1000 kph. At that speed, a transient network lag error of only 10 milliseconds results in a position error of several meters (dp = v * dt). It didn't matter that we knew the velocities to 7 significant figures or even if we'd known them to 17 significant figures, because the error in the timestamp overwhelmed that accuracy. The fix was to define a new coordinate system centered on the first plane. The velocity of the second plane was then only a few cm/sec relative to the first plane (since they're flying in formation), and the jumping disappeared since a 10 ms error only resulted in only a few millimeters of error.

  21. Fifteen places by Applehu+Akbar · · Score: 1

    'How I want a drink, alcoholic of course, after the heavy chapters involving quantum mechanics'

  22. Re:Marc's not quite right by ceoyoyo · · Score: 2

    Seems unlikely. The effects of general relativity and uncertainties in the orbits of various planets and the sun's mass would probably make several digits of a 10^-15 measurement useless. Plus even if you did make that measurement, it's not going to help you much because that's where your spacecraft was minutes or hours ago.

    It's possible NASA has timing hardware with 1 part in 10^15 precision because timing is pretty easy to do. It's unlikely they actually use all that precision for spacecraft navigation.

  23. News for nerds by Nkwe · · Score: 1

    This would be it. This is a good example of an article that should be on slashdot.

  24. Heck 3 is good enough by backslashdot · · Score: 1

    A value of 3 was good enough for the Bible, though back then the Earth had 4 corners.

    1. Re:Heck 3 is good enough by Harold+Halloway · · Score: 1

      22/7 has always been good enough for me.

  25. Re:so, the exact precision of double floating poin by coolsnowmen · · Score: 3, Insightful

    When tracking something in space and time, the coordinate system should never matter (it just makes the mathematical model easier or harder). You should have instead time tagged the state information. Then when the other platform received the state information, it extrapolates the state information to current time before using [displaying] it. The only requirement here is that your two platforms agree on the time to a high [enough] precision. While this is not a simple problem, it is well understood. Search for Kalman filtering and Sensor fusion for more information (advanced knowledge of signal processing is typically a perquisite).

    In sensor fusion you typical track in ECEF or LLA even though you will most commonly detect/search in LTP.

  26. Re:And those Republicans keep... by Aighearach · · Score: 1

    If you like pi pie, check out https://github.com/rubypanther...

    Then in your Ruby code you can say PiPie.[unicode pi symbol not shown]

    More pie in your pi! And more PI, too. (1m digits)

    It also has PiPie.Feynman if you only need up to the Feynman Point.

  27. Is the man at JPL wrong? by thegarbz · · Score: 1

    I'm usually quick to point out some incorrect garbage in the summary but this seems to come from JPL themselves so I'm cautiously asking if I did this right?

    15 decimal places of pi is 3.141592653589793.
    25billion miles is 40,000,000,000m or 40e9m

    40e9 * 3.141592653589793 - 40e9 * 3.141592653589792 = 40 e-6 or 40 micrometers.
    40 micrometers = 1.57 thousands of an inch, not 1.57 inches.

    Did I do something wrong or are NASA about to crash another rover?

    1. Re:Is the man at JPL wrong? by Anonymous Coward · · Score: 1

      I'm usually quick to point out some incorrect garbage in the summary but this seems to come from JPL themselves so I'm cautiously asking if I did this right?

      15 decimal places of pi is 3.141592653589793.
      25billion miles is 40,000,000,000m or 40e9m

      40e9 * 3.141592653589793 - 40e9 * 3.141592653589792 = 40 e-6 or 40 micrometers.
      40 micrometers = 1.57 thousands of an inch, not 1.57 inches.

      Did I do something wrong or are NASA about to crash another rover?

      You made an error:

      25billion mile is about 4.02336 × 10^13 meters not 40 × 10^9 meters.

    2. Re:Is the man at JPL wrong? by Anonymous Coward · · Score: 1

      "Did I do something wrong or are NASA about to crash another rover?"

      25B miles is 40e13m not 40e9 :)

    3. Re:Is the man at JPL wrong? by thegarbz · · Score: 1

      Since when do American English or British English speakers use long-scale?
      25 billion miles = 40 billion km.
      40 billion km = 40e9 meters or 4e10 meters.

      If this was published by the ESO I would agree but it was published by JPL.

    4. Re:Is the man at JPL wrong? by thegarbz · · Score: 1

      Americans use short scale
      1 = 1e0
      1 thousand = 1e3
      1 million = 1e6
      1 billion = 1e9

      40 billion = 4e10

  28. Digits by fyngyrz · · Score: 5, Funny

    eng1: How many digits of pi did you use?
    eng2: 16.
    eng1: So how come the spacecraft isn't on track? It's off by several tens of meters already, and we just launched.
    eng2: Meters?

    --
    I've fallen off your lawn, and I can't get up.
    1. Re:Digits by Bob_Who · · Score: 2

      .....Give them an inch, and they'll take a parsec.

  29. Re:How many digits to use - mod parent up by DCFusor · · Score: 1

    Logged in just to point this out. Ninja'd. On Pi day it's always fun to remind people of this - but they always act like you're a troll. No, just correct. Pi is only Pi in a flat space with no energy/mass in it. In other words, it's never equal to the formulas that calculate it out to N digits anywhere in the known universe, and at some point, just you being there to measure it would make it not right (not sure how many decimal places out, but in theory, even a human body warps space a little).

    --
    Why guess when you can know? Measure!
  30. 15 decimal places of Pi is interesting by CrashNBrn · · Score: 1

    I wondered what kinds of sequences one might find using the 15 digits of pi mentioned.

    So I took "141592653589793" and checked for easy factors. I got it down to 7 x 17 x 23 x 51732792689
    Wolfram Alpha said 73 was a prime factor (to) 708668393 ---> which is itself, a primitive pythagorean triple
    ---> 708668393**2 == 81521865**2 + 703963832**2

    Prime factorization of 81521865 == 3^2 x 5 x 241 x 7517
    Prime factorization of 703963832 == 2^3×11×13×19×139×233

    so, 15 digits of pi equals
    3 + (7 * 23 * 73 * ((3^2 x 5 x 241 x 7517)^2 + (2^3×11×13×19×139×233)^2)^0.5))e-15

  31. Re:How many digits to use - mod parent up by rubycodez · · Score: 1

    No, pi is independent of any circular thing in the real world, and also occurs in other realms than geometry. Pi is not the product of measurement in flat nor any other kind of space. It has (several) purely mathematical definitions

    Distortion of space has nothing to do with the value of pi, nor does it change it.

  32. Wrong geometry by purplie · · Score: 1

    The exact value of pi is only relevant in a flat (Newtonian) space-time, not in general relativity.

  33. Nasa uses miles and inches? Seriously? by Gunstick · · Score: 1

    when will they finally go metric?
    Also slashdot, a quite international website.

    --
    Atari rules... ermm... ruled.
  34. Re:How many digits to use - mod parent up by Mattcelt · · Score: 1

    But the GP's question was how much does the physical manifestation differ from pi? And in that case, spatial distortion has a very real effect.

    Pi is the ideal. But nothing in spacetime is ideal - chaos theory and resulting fractals down to the Planck length see to that.

  35. Re:How many digits to use - mod parent up by DCFusor · · Score: 1

    I'm aware of that - I've written books on Digital Signal Processing, for example. So, why in fact does everybody conflate pi with the ratio of the circumference to the diameter of a circle, without mentioning it's imaginary since there is no flat space in the known universe where that definition is actually true?
    You just moved the problem without solving it. Read article, title and so on.

    --
    Why guess when you can know? Measure!
  36. Re:so, the exact precision of double floating poin by coolsnowmen · · Score: 1

    Only true to a point, While my personal Research never took me to relativistic speeds. The people who built the GPS network would beg to different if you are trying to say the problem isn't solvable.

  37. Re:How many digits to use - mod parent up by rubycodez · · Score: 1

    You are confused. Pi is indeed the ratio of circumference and diameter of a circle as defined in geometry, but they do not occur anywhere in the real universe (as defined in geometry). People are confusing models of reality and geometric definitions with reality. Just as there are no ellipses in the real world (no real orbit is elliptical or circular), no ballistric trajectory is truly parabolic, etc. The shapes are useful for approximately modelling reality however.

  38. Finger size by coinreturn · · Score: 1

    less than the length of your little finger."

    Unless your name is Donald Trump.