Following Fast powi function topic, I made a fast-powi crate. I only implemented 8-bit exponents; i.e, i8 and u8. I don't know of any practical use of exponents greater than 127. This allowed me to hard-code all the shortest "addition-chains" (or multiplication-chains in this case) for all u8 exponents. I decided to implement the num crate numerical types. It is about 10X faster than the standard library powi for floats on my computer. It is about 20% faster than most ints, bigints, and ratios. It is about 50% faster for complex ratio types.
Here is a summary of the benchmarks from my laptop.
This could be useful for speeding up some graphics stuff like Phong–Blinn style specular highlights which use an exponent somewhere from 20 to 100 depending on the "shininess" desired.
Your right. I forgot about Phong–Blinn style specular highlights. I wrote one a few year ago while playing with WebGL, WebGL Demo 7: Normal Map. In my example I use a power of 256! The power is just beyond what my fast-powi crate can handle. The highlight intensity usually get written into the shader, so I am not sure it is applicable to for use with Rust (unless you can compile Rust into shaders, ¯_(ツ)_/¯ ).