To speed up my bignum divisons I need to speed up operation y = x^2
for bigints which are represented as dynamic arrays of unsigned DWORDs. To be clear:
If you're looking to write a new better exponent you might have to write it in assembly. This is the code from golang.
https://code.google.com/p/go/source/browse/src/pkg/math/exp_amd64.s
If I understand your algorithm correctly, it seems O(n^2)
where n
is the number of digits.
Have you looked at Karatsuba Algorithm? It speeds up multiplication using the divide and conquer approach. It may be worth taking a look at.