Is your range of inputs arbitrary, or known within a certain range?
in either case, xm = exp(m log x), so if you can create functions to evaluate exp(x) and log(x) and have a multiply, you're probably all set.
You'll have to figure out how you want to handle nonpositive values of x.
(hint for log(x): if this is IEEE-754 floating point, shift the significand if necessary until you end up with a range of numbers between 2k and 2k+1 for some value K. This lets you deal with a 2:1 range which isn't too hard to approximate with polynomials. Then you just have a small number of possibilities to handle for the exponent and the shift number.
Corresponding hint for exp(x): write x = k+b where 0 <= b < 1 and k is an integer. Then exp(x) = exp(k)*exp(b); b has limited range and k has a limited number of discrete possibilities.)
(hint #2: the numbers probably work out better for xm = g(m f(x)) where f(x) = log2x and g(x) = 2x.)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…