Use the pow
instruction (or the equivalent intrinsic function in HLSL). It takes 3 instruction slots, which indicates that it is reasonably quick.
I haven't sat down and figured out the exact cost of doing a lookup table. But you would struggle to find a useful implementation in fewer instruction slots. And obviously it requires a texture read (which is itself not free, and there's a good chance it will be a dependent texture read and so quite slow).
(Additionally: if a lookup texture were a better choice, then the GPU could just implement the pow
instruction like that itself.)
The reason that it used to be common to use a texture is that the pow
instruction did not exist for either vertex or pixel shaders in shader model 1.x. In 2.x and everything newer it is available (more instruction sets).