R, 346 bytes
Explanation.
Look up the atomic number in a UTF8 encoded hash string s. The hash is taken by multiplying the vector c(1,20) by the ASCII byte number of the characters of the element name, taking the sum, and taking that mod 430.
Use a quadratic fit curve to find the approximate mass from the atomic number. Eg for Lanthanum n=57 we get an approximate mass of -2.2+2.257+0.0041757^2 = 136.7483 and take the ceiling of that, 137.
Look up the correction which is an integer in [-5, 4] in another UTF8 encoded hash string, o. This is encoded with two offsets minus 5 per byte, e.g. for the 57th element, look up the 29th offset byte which is "K" or ASCII 75, take the tens place and subtract 5, e.g. 7-5 = 2. So for Lanthanum we add 2 to the quadratic fit, making 139 the mass.
function(x,n=match(sum(c(1,20)*!x)%%430,!'ÞŴŮ`uŜű ́źĪơK!ƆMÃĝğŗ"×ばつsÄÍłÕÜľŘĐŨƕś{
ŃƀóƄÙĞĨůÒŦnqăşńŒÇrʼnĊƈİkžåËúÿƜ^l·ëÈĮŅĬA ̈Ď_a8ƃÛd'))(-2.2+2.2*n+0.00417*n^2)%/%1+1+(!'8MK7@6+*$,5+ -887+-E9CK".8A--7-7-7) M9%%"')[n/2+.5]%/%10^(n%%2)%%10-5
"!"=utf8ToInt
- 2.7k
- 12
- 15