6 ms·
Perhaps the following statement from NASA will help ;-) "For JPL's highest accuracy calculations, which are for interplanetary navigation, we use 3.14159265358
by NKosmatos 2y ago
Perhaps the following statement from NASA will help ;-)
"For JPL's highest accuracy calculations, which are for interplanetary navigation, we use 3.141592653589793" (15 digits).
How Many Decimals of Pi Do We Really Need? : https://www.jpl.nasa.gov/edu/news/2016/3/16/how-many-decimals-of-pi-do-we-really-need/ https://www.jpl.nasa.gov/edu/news/2016/3/16/how-many-decimal...
- zamadatix 2y agoIt's a shame they don't mention why they use specifically 15 digits (because of doubles?). Would give some satisfaction to why the specific amount after the explanation.
- tomtom1337 2y agoAgreed! "What would happen if we were off by some tiny fraction" is a really interesting question to me!
- gnramires 2y agoSomething like spaceflight is subject to chaotic forces and unpredictable interactions, so having that many digits (more than 15 decimal) becomes negligible. (For example, a planetary force will probably vary by that much in ways models don't capture, like subtle tidal forces and subtle variations in its orbit, etc.). Navigation usually involves methods of measuring your position and adjusting course in theory needing much less precision. Simulating physical systems to extremely high precision (e.g. more than double precision) in general seems pointless in most situations because of those effects.
- fwip 2y agoAdding on to this - the physical characteristics of the spacecraft itself are also not machined to nearly 15 digits of tolerance, so these feedback systems are necessary even if the rest of the universe were perfectly modeled.
- snet0 2y agoI imagine that you'd want to use fixed-point arithmetic when it comes to these things, right? Floating-point numbers are good enough for a lot of things, but the precise thing they're bad at is dealing in high precision at multiple orders of magnitude, which feels like a thing NASA would kinda need.
- mr_mitm 2y agoA lot of the parameters that enter their equations are probably measurements, like the gravitational acceleration, properties of some material, and so on. The numerical solutions to their equations have an error that is at least that of the most unprecise parameter, which I can't imagine to be more than four significant digits, so doubles should provide plenty of precision. The error introduced by the numerical algorithms can be controlled. I don't see why you'd need fixed point arithmetic.
- snet0 2y agoOkay yeah, what you're saying seems true. I guess the GP comment was discussing that, with this new measurement of pi, we now have enough precision (in pi) to reference a point this small on an object this far away. Once you account for all the other uncertainties in referencing that point, as you mentioned, all that precision in one dimension of the measurement is completely meaningless. It still feels weird that you'd use an arithmetic with guaranteed imprecision in a field like this, but I can definitely see that, as long as you constrain the scales, it's more than enough.
- lanstin 2y agoThey put in scheduled fix the course burns, as there's a lot of uncertainty outside the math - the fuel burns probably can't be controlled to 5 sig figs, for example. Also, although I have no idea if this matters, N-body orbital mechanics itself is a chaotic system, and there will be times when the math just won't tell you the answer. https://botsin.space/@ThreeBodyBot https://botsin.space/@ThreeBodyBot if you like to see a lot of examples of 3-body orbits. (maybe just in 2d, I'm not sure).
- 2y ago
- _a_a_a_ 2y agoThey do say why. By example.
- zamadatix 2y agoIf a double had happened to give 14 significant figures the article would list the exact same "why" 14 is enough. I.e. the article explains why it's more than enough, it doesn't explain why it's the exact number of digits used.
- pclmulqdq 2y ago16 decimal places (really about 15.9 decimal places) is what you get with double-precision floating point. Double-double would be about 31 digits, and quad precision would get you 34. Single-precision gets you a bit more than 7 digits.
- zamadatix 2y agoThe double representation of pi just so happens to be accurate to precisely 15 digits even though the general amount of precision is slightly higher.
- zamadatix 2y agoMissed in my other response: Double gives about double the precision, not 4 times, that of a single: "The 53-bit significand precision gives from 15 to 17 significant decimal digits precision (2−53 ≈ 1.11 × 10−16). If a decimal string with at most 15 significant digits is converted to the IEEE 754 double-precision format, giving a normal number, and then converted back to a decimal string with the same number of digits" (from Wikipedia)
- DrNosferatu 2y agoI suppose because that’s what “atan(1) * 4” casts to double? - I wonder if this cast is always correct in C [ie.: math.h], no matter the datatype and/or the number base?
- constantcrying 2y ago>- I wonder if this cast is always correct in C [ie.: math.h], no matter the datatype and/or the number base? Floating point arithmetic is deterministic. As long as it is implemented as specified atan(1) has to give the floating point number which is the closest approximation to the real number pi/4 (in the current rounding mode), the multiplication by 4 means that precision can be lost and potentially your result is no longer the closest possible approximation to pi.
- adgjlsfhk1 2y agothis isn't true. the standard only recommends correct rounding, but does not actually set any limits on acceptable error. also, no OS provided libm produces correctly rounded results for all inputs.
- constantcrying 2y ago> the standard only recommends correct rounding What? This is not true at all. The standards specifies adherence to IEEE 754 arithmetic. You can read the standard here: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf Page 507 for adherence to number formats. Page 517 for atan adhering to IEEE 754 specification for the functions defined therein, which guarantees best possible results for individual operations. Any C implementation where atan gives a result which is inconsistent with IEEE 754 specification does not adhere to the standard. > also, no OS provided libm produces correctly rounded results for all inputs. Every IEEE 754 conforming library does adhere to the best possible rounding guarantee. If you have any evidence to the contrary that would be a disaster and should be reported to the vendor of that library ASAP. Can you provide some function and some input which violates the IEEE 754 guarantee together with the specific library and version? Or are you just making stuff up?
- kens 2y agoThat NASA article kind of misses the point. NASA uses 15 digits for pi because that's the default and it is enough accuracy for them. The interesting question is why is that the default. That goes back to the Intel 8087 chip, the floating-point coprocessor for the IBM PC. A double-precision real in the 8087 provided ~15 digits of accuracy, because that's the way Berkeley floating-point expert William Kahan designed its number representation. This representation was standardized and became the IEEE 754 floating point standard that almost everyone uses now. By the way, the first Ariane 5 launch blew up because of floating point error, specifically an overflow when converting a 64-bit float to an int. So be careful with floats!
- jcranmer 2y ago> NASA uses 15 digits for pi because that's the default and it is enough accuracy for them. The interesting question is why is that the default. The general rule of thumb in numerical analysis is you need roughly twice the working precision as the output precision. Double-precision floating point has ~16 decimal digits of precision, which means the output should generally be good for ~8 decimal digits; with single-precision, you have ~7 decimal digits of working precision, or about ~3-4 decimal digits of output precision. In other words, a 32-bit floating-point number doesn't leave with enough useful precision for many cases, whereas a 64-bit floating-point number is good for most use cases. > That goes back to the Intel 8087 chip, the floating-point coprocessor for the IBM PC. A double-precision real in the 8087 provided ~15 digits of accuracy, because that's the way Berkeley floating-point expert William Kahan designed its number representation. This representation was standardized and became the IEEE 754 floating point standard that almost everyone uses now. It predates 8087! VAX had 64-bit floats with similar precision to IEEE 754 double precision. There's probably even older uses of 64-ish-bit floating-point types, but my knowledge of computers in the 60's and 70's is pretty poor. I fully expect you'd see similar results on those computers, though: you need enough decimal digits for working precision, and word-sized floating point numbers are just too small to have enough. The 8087 itself doesn't use double precision types, it uses 80-bit types internally, which have 64 bits of mantissa (or ~19 decimal digits), although the reason for the 80-bit type is primarily to get higher precision for intermediate results on implementing transcendental functions.