Does the error in the ephemeris come from the input, the formula, or the machine?
The same result has to go through four levels: input, algorithm, internal operation, and final display. Don't confuse them into one "accuracy".
General Algorithms and Numerical Computing
A program may display many decimals, but input times may have been rounded, formulas may have omitted terms, and internal operations may lose detail. Only by taking apart these steps one by one can you know where the changes are really useful; just changing the output format usually cannot change the previous errors.
Guess first
If the internal miscalculated 125° is displayed as 125.000000000°, can the missing decimal be recovered?
Show answer and explanation
cannot — String lengthening does not restore information that has been lost during the input, algorithm, or operation.
Then connect experience and science
Are the entered details discarded first?
Retaining only a few decimal places for T is equivalent to bolding the query time first. If I use the exact formula later, I can't find the original input.
Input rounding error ≠ Formula approximation error
What terms are omitted from the formula itself?
Actively omitting T² and T³ will change the results. This is a difference caused by algorithm choice, and cannot be fixed by adding a few zeros to the last line.
Compare the complete selected version and the omitted version separately
Machines can only retain limited details
The large angle is first calculated to hundreds of thousands of degrees and then normalized, which will expose insufficient internal effective bits. When the cos of the small angle is close to 1, the included angle may be lost if you directly reverse the calculation.
Choose a numerically stable calculation route
Finally decide how to display
In the Neptune example in the original book, the complete angle is first calculated and then rounded to get 19°; the two inputs are first rounded to get 20°. The number of displayed digits must match the input and model accuracy.
Calculate first, then do meaningful final rounding
Rounding, arithmetic truncation, and floating-point errors are entered separately, and then the fully selected written and omitted versions are compared using the same input. Displaying a few more decimal places at the end of a result does not automatically improve the accuracy of a scientific model.
give it a try
Look at "only 6 digits internally" first, then change the display to 9 digits - the answer will not be any closer to the reference. Expansion conditions vary the input, algorithm, and internal precision respectively; small angle and final rounding cases are separate issues.
No need to memorize symbols
- T
- Julian century from J2000; 0.4 is approximately J2040.0
- internal valid bits
- The precision of decimal operation simulated in this lesson is not to modify the JS hardware format.
- Show decimal places
- String format, does not change the calculation process
- acos / atan2
- Two mathematically equivalent but numerically different routes to small-angle inversion
Algorithm, accuracy and scope of application
Supplement Chapter 2 on the differences between the accuracy required for calculation targets, machine accuracy and final report accuracy to avoid repeating the subtraction of nearest numbers in the old weighing lesson. Experiment 0 uses the lunar mean celestial longitude polynomial of Printed Page 17 218.3164477+481267.88123421T−0.0015786T²+0.0000019T³; this is the truncated book formula of Chapter 2, not the complete lunar true celestial longitude. The comparison input T is rounded, the higher-order terms are actively omitted, the decimal significant digits are simulated operation by operation, and finally four layers of effects are displayed. The so-called reference is the double-precision mathematical result of the same book formula, not the measured true value or the upper bound of the true ephemeris error. Experiment 1 uses small angle warning in Chapter 1/2: atan2(sinθ, cosθ) is compared with acos(cosθ); the former still cannot recover the lost input information. Experiment 2 reproduces the premature rounding error of Neptune on Sonneberg in 1996 and 1.4+1.4; Experiment 3 reproduces the continuous square of 1.0000001, and uses log1p/exp to independently check it with the reference value in the book; Experiment 4 reproduces x←(9x+1)x−1, but the mathematical fixed point 1/3 will deviate in floating point operations. The hardware-specific output of the original book is not intended to be a fixed result for all machines. If the iteration exceeds 1e100 or stops in a non-limited time, the model T range is limited to ±1 century; see also the Planetary Illumination/Magnitude Course for the number of significant digits in magnitude.
my understanding check
The complete formula is different from the omitted version. Which level of error is mainly caused?
algorithm approximation — Omitted terms directly change the mathematical calculation model.
If cos has rounded a very small angle to 1, can the original angle be restored using acos?
No, you need to retain more valid information or change a stable route — The same input 1 cannot distinguish whether it is originally a zero angle or a very small non-zero angle.
Should March 15.88 be simply rounded to March 16?
No, the date still belongs to the 15th — It means 0.88 days after midnight on the 15th. Date label segmentation is not the same operation as final numerical rounding.
First identify which level the error is at, and then decide whether to supplement the data, change the formula, change the numerical method, or just adjust the number of reported digits.
Jean Meeus · Astronomical Algorithms, 2nd ed. · No. 2 chapter
General Algorithms and Numerical Computing · All interactive courses