The table holds the values of exp
for arguments in the range -6
to 6
. The function is sampled at 1001 points.
The following code in the same source file word2vec.c
uses this table to calculate exponents:
...
if (f <= -MAX_EXP) continue;
else if (f >= MAX_EXP) continue;
else f = expTable[(int)((f + MAX_EXP) * (EXP_TABLE_SIZE / MAX_EXP / 2))];
...
(So if you wonder what value there is at the first cell of the table - it's exp(-6)
)