optimize finding non-integer power