You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
math/big currently only has an implementation of "schoolbook" long division which is O(n^2). An implementation of Burnikel and Ziegler's Fast Recursive Division (1998) would improve division's asymptotic complexity to the multiplication time. The multiplication asymptotic complexity is currently ~n^1.6 for the karatsuba implementation, but could be improved with other algorithms in the future and recursive division would automatically benefit.
Note, The Handbook of Elliptic and Hyperelliptic Cryptography Algorithm 10.35 on page 188 has a more explicit version of the div2NxN algorithm. This algorithm is directly recursive and avoids the mutual recursion of the original paper's calls between div2NxN and div3Nx2N. Algorithm 10.35 along with the Burnikel and Ziegler's handling of unbalanced division in blocks of 2NxN "digits" seems like the best candidate for implementation.
In addition to speeding up division in general, this will improve String output #20906 which relies on repeated large divisions.
The text was updated successfully, but these errors were encountered:
Note: Burnikel and Ziegler's Fast Recursive Division is also an ingredient of the Karatsuba Square Root algorithm [1], which is the method gmp and mpfr use for computing square roots. It should be faster than the Newton approach currently used in Float.Sqrt.
math/big currently only has an implementation of "schoolbook" long division which is O(n^2). An implementation of Burnikel and Ziegler's Fast Recursive Division (1998) would improve division's asymptotic complexity to the multiplication time. The multiplication asymptotic complexity is currently ~n^1.6 for the karatsuba implementation, but could be improved with other algorithms in the future and recursive division would automatically benefit.
Note, The Handbook of Elliptic and Hyperelliptic Cryptography Algorithm 10.35 on page 188 has a more explicit version of the div2NxN algorithm. This algorithm is directly recursive and avoids the mutual recursion of the original paper's calls between div2NxN and div3Nx2N. Algorithm 10.35 along with the Burnikel and Ziegler's handling of unbalanced division in blocks of 2NxN "digits" seems like the best candidate for implementation.
In addition to speeding up division in general, this will improve String output #20906 which relies on repeated large divisions.
The text was updated successfully, but these errors were encountered: