Does anyone know an algorithm for a Pow2() function for fractions?
For a function of the following form, where BigRational stands for any rational number type, with arbitrarily large integers for numerator and denominator:
BigRational Pow2(BigRational exponent, int maxdigits)
For the inverse function, BigRational Log2(BigRational exponent, int maxdigits)
, I have already found a very nice algorithm that uses several identities, converges quickly, and is many times faster than corresponding Log (Ln) or Log10 functions.
Of course, Pow2(x) works with Exp(x * Log(2)) but the point is to avoid Exp as this function is relatively slow for arbitrary precesission arithmetic.
Currently I work on an library for arbitrary precision arithmetic based on some new foundations:
https://github.com/c-ohle/RationalNumerics
An efficient algorithm for such a Pow2 function that is more powerful than Exp (based on Taylor series) could improve the performance of many other functions and algorithms for arbitrary arithmetic.