Is a lookup table the best option?

However a small lookup table, kept in PROGMEM, might save the necessity of including code to calculate it (eg. to do logarithms). You might need to test empirically, but possibly the lookup table could use less space, and be faster.