I've now created https://github.com/barrycarter/bcapps/blob/master/MATHEMATICA/nearestPhysicalConstant.mx
as a first cut at doing this. Important notes/caveats:
This is not a professional/"real" package. To use, do math -initfile
PhysicalConstant.mx on the command line or <<PhysicalConstant.mx after
starting Mathematical.
The function nearestPhysicalConstant returns the entire list of known
constants, sorted by mantissa distance from the argument. You will
probably want just the few entries of the result. Example:
Take[nearestPhysicalConstant[Pi*E],5] // TeXForm
$
\left(
\begin{array}{cc}
\{\text{deuteron mag. mom. to nuclear magneton
ratio},0.857438,\text{4.8$\grave{ }$*${}^{\wedge}$-9},1\} & -0.00346481 \\
\{\text{deuteron g factor},0.857438,\text{4.8$\grave{
}$*${}^{\wedge}$-9},1\} & -0.00346481 \\
\{\text{atomic unit of electric dipole mom.},\text{8.478353551999999$\grave{
}$*${}^{\wedge}$-30},\text{5.2$\grave{ }$*${}^{\wedge}$-38},C m\} &
0.00613807 \\
\left\{\text{Boltzmann constant in
eV/K},0.0000861733,\text{5.000000000000001$\grave{
}$*${}^{\wedge}$-11},\frac{\text{eV}}{K}\right\} & -0.00775961 \\
\{\text{electron to shielded helion mag. mom. ratio},864.058,0.00001,1\} &
-0.0100848 \\
\end{array}
\right)
$
Taking a closer look at just the first result:
nearestPhysicalConstant[Pi*E][[1]] // InputForm
{{"deuteron mag. mom. to nuclear magneton ratio", 0.8574382311, 4.8*^-9, 1}, -0.003464808832643218}
Assigning x to the result above, here's what the result means:
x[[1,1]]: the name of the physical constant
x[[1,2]]: the value of the physical constant. Note that Pi*E is 8.53973,
but the constant value is 0.857438. This is considered a close match
because I only compare mantissas, not the entire number.
x[[1,3]]: uncertainty in the physical constant
x[[1,4]]: units of the physical constant ("1" meaning unitless). I
didn't make any effort to clean this up, so you shouldn't rely on it or
use it without doublechecking.
x[[2]]: the difference in mantissas of your provided number and the
physical constant.
I'm using http://physics.nist.gov/cuu/Constants/Table/allascii.txt as my
list of constants, but it's far from complete. For example,
/usr/local/Wolfram/Mathematica/9.0/AddOns/Packages/PhysicalConstants/PhysicalConstants.m
includes EarthRadius, where as the NIST list does not, not even in
alternate units (and not the earth's diameter or anything like that
either).
All NIST constants are in the SI (metric) system, so nearestPhysicalConstant
will recognize 9.8 as being close to "standard acceleration of gravity",
but won't recognize 32 (the first result for 32 is "atomic unit of 1st
hyperpolarizability"). As others have noted, you should only use
nearestPhysicalConstant if you are dealing in SI (metric) units.
I plan to add more constants, but since there is limited usefulness
here. For example, "1.4815*10^23" is the mass of Ganymede, but I'm not
sure how useful it would be to add that. Additionally, the function is
written inefficiently and may become too slow with the addition of more
constants (though I could potentially recode it at some point).
For reference, I used the following programs to create this "package":
https://github.com/barrycarter/bcapps/blob/master/MATHEMATICA/bc-solve-mathematica-104178.m
https://github.com/barrycarter/bcapps/blob/master/MATHEMATICA/bc-solve-mathematica-104178.pl
I welcome any improvements to this open source code.