You could still build a lookup table and use some interpolation between some points, that should do the trick and way easy to implement.