Skip to content

constants: CODATA 2022 uncertainties of μeμB and mnmp - #1853

Open
Wiljea wants to merge 4 commits into
c3d:devfrom
Wiljea:fix-codata-ratio-uncertainties
Open

Wiljea wants to merge 4 commits into
c3d:devfrom
Wiljea:fix-codata-ratio-uncertainties

Conversation

@Wiljea

@Wiljea Wiljea commented Oct 25, 2026

Copy link
Copy Markdown

Problem

I compared the 100 constants of the library outside Astronomy and Materials
with the CODATA 2022 table of NIST (allascii.txt), evaluating each value and
its standard uncertainty in SI units with 24 digits. The 71 that are in CODATA
agree in value (all within 0.05 σ, exact ones to the printed digits). Two
uncertainties do not:

Constant dev CODATA 2022
μeμB, electron magnetic moment to Bohr magneton ratio ± 1.1E-13 ± 1.8E-13
mnmp, neutron to proton mass ratio ± 5.1E-10 ± 4.0E-10

Their relative uncertainties were recomputed from the two terms of the ratio
(Ⓢμe/Ⓒμe; Ⓢmn/Ⓒmn+Ⓢmp/Ⓒmp), as if they were independent. CODATA adjusts
these ratios directly, with the correlations, so the published uncertainty is
the one to use.

Fix

Both take the CODATA 2022 standard uncertainty, and their relative uncertainty
is computed from it. The two expectations of src/tests.cc that show these
constants follow.

These two lines also change in #1852 (± becomes ±σ). Whichever is merged
second has a one-line conflict on each; the final expectations are
-1.00115 96521 8±σ1.8⁳⁻¹³ and 1.00137 84194 6±σ4.⁳⁻¹⁰.

Tests

Full test suite on the current dev with this commit: DB48x 8455 pass, 0 fail,
as on dev alone.

Author & design: Jean Wilson
🤖 Generated with Claude Code

Wiljea and others added 4 commits October 25, 2026 17:10
constant::range(), used by ConstantRange and by the right-shifted key of the
constants menus, built a delta range a±b from the value and the second field
of the constant. That field is a standard uncertainty: StandardUncertainty
returns it, and CODATA gives "the one-standard-deviation uncertainty". A
bound and a standard deviation do not combine the same way, and they do not
mix: a constant times a user's ±σ measurement gave "Bad argument type".

ConstantRange now builds an uncertain value a±σb. Exact constants give x±σ0.
The 108 test expectations that showed a constant range change from ± to ±σ;
for Undefined the centre is no longer recomputed as (lo+hi)/2.

ConstantRange had no help: the new entry shows it on the stack and in an
algebraic expression, and says how to cycle a value with a unit.

Fixes c3d#1850.

Author & design: Jean Wilson

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CstRng was only on the third page of the Parts menu. The Range menu, where
the other ways to build a range are, had room for it: it goes last, so that
no existing key moves.

Author & design: Jean Wilson

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The standard uncertainties of the electron magnetic moment to Bohr magneton
ratio and of the neutron to proton mass ratio were 1.1E-13 and 5.1E-10,
while CODATA 2022 gives 1.8E-13 and 4.0E-10. Their relative uncertainties
were recomputed from those of the two terms of the ratio, as if they were
independent; CODATA adjusts these ratios directly, with the correlations,
so they now use the published values.

The other 69 CODATA constants of the library agree with CODATA 2022, in
value and uncertainty, when compared with the NIST table (allascii.txt).

Author & design: Jean Wilson

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Wiljea
Wiljea force-pushed the fix-codata-ratio-uncertainties branch from c13b31e to c4a8a40 Compare November 5, 2026 15:18
@Wiljea

Wiljea commented Nov 5, 2026

Copy link
Copy Markdown
Author

Rebased on #1852 (fix-constant-range-sigma), which touched the same two test lines for μeμB and mnmp. Please merge #1852 first; this PR then merges without conflict.

Author & design: Jean Wilson
🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant