Skip to content

Commit 3bbd48d

Browse files
Wiljeaclaude
andcommitted
constants: fix rounding of computed astronomy constants (wrot, f-earth/jupiter)
Two rounding defects in computed Astronomy constants, both verified on the simulator (-Tcstlib "built-in constants parsing" = 0 failures): - wrot (all 11 bodies): the absolute uncertainty was rounded *after* UBASE, which expresses r/s in the angular base unit turn/s (x 1/2pi); converting the rounded value back to r/s multiplied by 2pi and destroyed the 2-significant- figure rounding. Round directly in r/s instead, keeping the positive magnitude (so retrograde bodies still get a positive uncertainty). Now e.g. wrot-earth absolute uncertainty = 8.8e-14 r/s (2 s.f.). - f-earth and f-jupiter (oblateness): computed from EXACT (IAU nominal) radii, so their relative uncertainty is 0; the uncertainty-driven rounding then degenerated (XPON(UVAL(0)) = -1 => round to 0 significant figures), collapsing f-earth to 0 and f-jupiter to 0.06. As the inputs are exact, round to a fixed 5 significant figures (the precision of the radii): f-earth = 0.0033396, f-jupiter = 0.064874. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent aa3d5ce commit 3bbd48d

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

src/constants.cc

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,7 +1254,7 @@ static const cstring basic_constants[] =
12541254
" 5.067E6_s ]",
12551255
// *Mercury rotation angular velocity - Calculation from Prot
12561256
"ωrot☿", "[ 'ROUND(CONVERT((2*Ⓒπ*1_r)/ⒸProt☿;1_r/s);XPON(UVAL(Ⓡωrot☿*(2*Ⓒπ*1_r)/ⒸProt☿))-XPON(UVAL((2*Ⓒπ*1_r)/ⒸProt☿))-2)' "
1257-
" 'CONVERT(ROUND(UBASE(Ⓡωrot☿*(2*Ⓒπ*1_r)/ⒸProt☿);-2);1_r/s)' "
1257+
" 'CONVERT(ROUND(Ⓡωrot☿*(2*Ⓒπ*1_r)/ⒸProt☿;-2);1_r/s)' "
12581258
" 'ⓇProt☿' ]",
12591259
// *Mercury axial tilt - Measurement [22]
12601260
"ϵ☿", "[ 0.034_° "
@@ -1338,7 +1338,7 @@ static const cstring basic_constants[] =
13381338
" 2.100E7_s ]",
13391339
// *Venus rotation angular velocity - Calculation from Prot [retrograde]
13401340
"ωrot♀", "[ 'ROUND(CONVERT(-(2*Ⓒπ*1_r)/ⒸProt♀;1_r/s);XPON(UVAL(Ⓡωrot♀*(2*Ⓒπ*1_r)/ⒸProt♀))-XPON(UVAL((2*Ⓒπ*1_r)/ⒸProt♀))-2)' "
1341-
" 'CONVERT(ROUND(UBASE(Ⓡωrot♀*(2*Ⓒπ*1_r)/ⒸProt♀);-2);1_r/s)' "
1341+
" 'CONVERT(ROUND(Ⓡωrot♀*(2*Ⓒπ*1_r)/ⒸProt♀;-2);1_r/s)' "
13421342
" 'ⓇProt♀' ]",
13431343
// *Venus axial tilt - Measurement [22]
13441344
"ϵ♀", "[ 177.36_° "
@@ -1396,7 +1396,7 @@ static const cstring basic_constants[] =
13961396
" 0_km "
13971397
" 0 ]",
13981398
// *Earth oblateness - Calculation from nominal value [3]
1399-
"f♁", "[ 'ROUND(1-ⒸRp♁/ⒸReq♁;XPON(UVAL(Ⓡf♁*(1-ⒸRp♁/ⒸReq♁)))-XPON(1-ⒸRp♁/ⒸReq♁)-2)' "
1399+
"f♁", "[ 'ROUND(1-ⒸRp♁/ⒸReq♁;-5)' "
14001400
" 'ROUND(Ⓡf♁*Ⓒf♁;-2)' "
14011401
" 'ⓇRp♁+ⓇReq♁' ]",
14021402
// *Earth mean density - Calculation from nominal value [3]
@@ -1420,7 +1420,7 @@ static const cstring basic_constants[] =
14201420
" 8.616E4_s ]",
14211421
// *Earth rotation angular velocity - Calculation from Prot
14221422
"ωrot♁", "[ 'ROUND(CONVERT((2*Ⓒπ*1_r)/ⒸProt♁;1_r/s);XPON(UVAL(Ⓡωrot♁*(2*Ⓒπ*1_r)/ⒸProt♁))-XPON(UVAL((2*Ⓒπ*1_r)/ⒸProt♁))-2)' "
1423-
" 'CONVERT(ROUND(UBASE(Ⓡωrot♁*(2*Ⓒπ*1_r)/ⒸProt♁);-2);1_r/s)' "
1423+
" 'CONVERT(ROUND(Ⓡωrot♁*(2*Ⓒπ*1_r)/ⒸProt♁;-2);1_r/s)' "
14241424
" 'ⓇProt♁' ]",
14251425
// *Earth axial tilt - Measurement [24]
14261426
"ϵ♁", "[ 23.4393_° "
@@ -1547,7 +1547,7 @@ static const cstring basic_constants[] =
15471547
" 2.361E6_s ]",
15481548
// *Moon rotation angular velocity - Calculation from Prot
15491549
"ωrot☽", "[ 'ROUND(CONVERT((2*Ⓒπ*1_r)/ⒸProt☽;1_r/s);XPON(UVAL(Ⓡωrot☽*(2*Ⓒπ*1_r)/ⒸProt☽))-XPON(UVAL((2*Ⓒπ*1_r)/ⒸProt☽))-2)' "
1550-
" 'CONVERT(ROUND(UBASE(Ⓡωrot☽*(2*Ⓒπ*1_r)/ⒸProt☽);-2);1_r/s)' "
1550+
" 'CONVERT(ROUND(Ⓡωrot☽*(2*Ⓒπ*1_r)/ⒸProt☽;-2);1_r/s)' "
15511551
" 'ⓇProt☽' ]",
15521552
// *Moon axial tilt - Measurement [22]
15531553
"ϵ☽", "[ 1.5424_° "
@@ -1631,7 +1631,7 @@ static const cstring basic_constants[] =
16311631
" 8.864E4_s ]",
16321632
// *Mars rotation angular velocity - Calculation from Prot
16331633
"ωrot♂", "[ 'ROUND(CONVERT((2*Ⓒπ*1_r)/ⒸProt♂;1_r/s);XPON(UVAL(Ⓡωrot♂*(2*Ⓒπ*1_r)/ⒸProt♂))-XPON(UVAL((2*Ⓒπ*1_r)/ⒸProt♂))-2)' "
1634-
" 'CONVERT(ROUND(UBASE(Ⓡωrot♂*(2*Ⓒπ*1_r)/ⒸProt♂);-2);1_r/s)' "
1634+
" 'CONVERT(ROUND(Ⓡωrot♂*(2*Ⓒπ*1_r)/ⒸProt♂;-2);1_r/s)' "
16351635
" 'ⓇProt♂' ]",
16361636
// *Mars axial tilt - Measurement [22]
16371637
"ϵ♂", "[ 25.19_° "
@@ -1687,7 +1687,7 @@ static const cstring basic_constants[] =
16871687
" 0_km "
16881688
" 0 ]",
16891689
// *Jupiter oblateness - Calculation from nominal value [3]
1690-
"f♃", "[ 'ROUND(1-ⒸRp♃/ⒸReq♃;XPON(UVAL(Ⓡf♃*(1-ⒸRp♃/ⒸReq♃)))-XPON(1-ⒸRp♃/ⒸReq♃)-2)' "
1690+
"f♃", "[ 'ROUND(1-ⒸRp♃/ⒸReq♃;-5)' "
16911691
" 'ROUND(Ⓡf♃*Ⓒf♃;-2)' "
16921692
" 'ⓇRp♃+ⓇReq♃' ]",
16931693
// *Jupiter mean density - Calculation from nominal value [3]
@@ -1710,7 +1710,7 @@ static const cstring basic_constants[] =
17101710
" 'ROUND(ⓈProt♃/ⒸProt♃;-2)' ]",
17111711
// *Jupiter rotation angular velocity - Calculation from Prot
17121712
"ωrot♃", "[ 'ROUND(CONVERT((2*Ⓒπ*1_r)/ⒸProt♃;1_r/s);XPON(UVAL(Ⓡωrot♃*(2*Ⓒπ*1_r)/ⒸProt♃))-XPON(UVAL((2*Ⓒπ*1_r)/ⒸProt♃))-2)' "
1713-
" 'CONVERT(ROUND(UBASE(Ⓡωrot♃*(2*Ⓒπ*1_r)/ⒸProt♃);-2);1_r/s)' "
1713+
" 'CONVERT(ROUND(Ⓡωrot♃*(2*Ⓒπ*1_r)/ⒸProt♃;-2);1_r/s)' "
17141714
" 'ⓇProt♃' ]",
17151715
// *Jupiter axial tilt - Measurement [22]
17161716
"ϵ♃", "[ 3.13_° "
@@ -1793,7 +1793,7 @@ static const cstring basic_constants[] =
17931793
" 3.836E4_s ]",
17941794
// *Saturn rotation angular velocity - Calculation from Prot
17951795
"ωrot♄", "[ 'ROUND(CONVERT((2*Ⓒπ*1_r)/ⒸProt♄;1_r/s);XPON(UVAL(Ⓡωrot♄*(2*Ⓒπ*1_r)/ⒸProt♄))-XPON(UVAL((2*Ⓒπ*1_r)/ⒸProt♄))-2)' "
1796-
" 'CONVERT(ROUND(UBASE(Ⓡωrot♄*(2*Ⓒπ*1_r)/ⒸProt♄);-2);1_r/s)' "
1796+
" 'CONVERT(ROUND(Ⓡωrot♄*(2*Ⓒπ*1_r)/ⒸProt♄;-2);1_r/s)' "
17971797
" 'ⓇProt♄' ]",
17981798
// *Saturn axial tilt - Measurement [22]
17991799
"ϵ♄", "[ 26.73_° "
@@ -1876,7 +1876,7 @@ static const cstring basic_constants[] =
18761876
" 6.206E4_s ]",
18771877
// *Uranus rotation angular velocity - Calculation from Prot [retrograde]
18781878
"ωrot⛢", "[ 'ROUND(CONVERT(-(2*Ⓒπ*1_r)/ⒸProt⛢;1_r/s);XPON(UVAL(Ⓡωrot⛢*(2*Ⓒπ*1_r)/ⒸProt⛢))-XPON(UVAL((2*Ⓒπ*1_r)/ⒸProt⛢))-2)' "
1879-
" 'CONVERT(ROUND(UBASE(Ⓡωrot⛢*(2*Ⓒπ*1_r)/ⒸProt⛢);-2);1_r/s)' "
1879+
" 'CONVERT(ROUND(Ⓡωrot⛢*(2*Ⓒπ*1_r)/ⒸProt⛢;-2);1_r/s)' "
18801880
" 'ⓇProt⛢' ]",
18811881
// *Uranus axial tilt - Measurement [22]
18821882
"ϵ⛢", "[ 97.77_° "
@@ -1958,7 +1958,7 @@ static const cstring basic_constants[] =
19581958
" 'ROUND(ⓈProt♆/ⒸProt♆;-2)' ]",
19591959
// *Neptune rotation angular velocity - Calculation from Prot
19601960
"ωrot♆", "[ 'ROUND(CONVERT((2*Ⓒπ*1_r)/ⒸProt♆;1_r/s);XPON(UVAL(Ⓡωrot♆*(2*Ⓒπ*1_r)/ⒸProt♆))-XPON(UVAL((2*Ⓒπ*1_r)/ⒸProt♆))-2)' "
1961-
" 'CONVERT(ROUND(UBASE(Ⓡωrot♆*(2*Ⓒπ*1_r)/ⒸProt♆);-2);1_r/s)' "
1961+
" 'CONVERT(ROUND(Ⓡωrot♆*(2*Ⓒπ*1_r)/ⒸProt♆;-2);1_r/s)' "
19621962
" 'ⓇProt♆' ]",
19631963
// *Neptune axial tilt - Measurement [22]
19641964
"ϵ♆", "[ 28.32_° "
@@ -2040,7 +2040,7 @@ static const cstring basic_constants[] =
20402040
" 5.519E5_s ]",
20412041
// *Pluto rotation angular velocity - Calculation from Prot [retrograde]
20422042
"ωrot♇", "[ 'ROUND(CONVERT(-(2*Ⓒπ*1_r)/ⒸProt♇;1_r/s);XPON(UVAL(Ⓡωrot♇*(2*Ⓒπ*1_r)/ⒸProt♇))-XPON(UVAL((2*Ⓒπ*1_r)/ⒸProt♇))-2)' "
2043-
" 'CONVERT(ROUND(UBASE(Ⓡωrot♇*(2*Ⓒπ*1_r)/ⒸProt♇);-2);1_r/s)' "
2043+
" 'CONVERT(ROUND(Ⓡωrot♇*(2*Ⓒπ*1_r)/ⒸProt♇;-2);1_r/s)' "
20442044
" 'ⓇProt♇' ]",
20452045
// *Pluto axial tilt - Measurement [26]
20462046
"ϵ♇", "[ 119.591_° "
@@ -2126,7 +2126,7 @@ static const cstring basic_constants[] =
21262126
" 2.193E6_s ]",
21272127
// *Sun rotation angular velocity - Calculation from Prot
21282128
"ωrot☉", "[ 'ROUND(CONVERT((2*Ⓒπ*1_r)/ⒸProt☉;1_r/s);XPON(UVAL(Ⓡωrot☉*(2*Ⓒπ*1_r)/ⒸProt☉))-XPON(UVAL((2*Ⓒπ*1_r)/ⒸProt☉))-2)' "
2129-
" 'CONVERT(ROUND(UBASE(Ⓡωrot☉*(2*Ⓒπ*1_r)/ⒸProt☉);-2);1_r/s)' "
2129+
" 'CONVERT(ROUND(Ⓡωrot☉*(2*Ⓒπ*1_r)/ⒸProt☉;-2);1_r/s)' "
21302130
" 'ⓇProt☉' ]",
21312131

21322132
"Astronomy/Cosmology", nullptr,

0 commit comments

Comments
 (0)