[9] RFR of 8032027: Add BigInteger square root methods

Brian Burkhalter brian.burkhalter at oracle.com
Thu Oct 8 02:02:34 UTC 2015


Joe / Andrew / Louis,

Following up on the thread regarding https://bugs.openjdk.java.net/browse/JDK-8032027.

I revised the algorithm similarly to what Louis suggested for the initial value of the iteration. I also tightened up the memory usage. The updated version is here:

http://cr.openjdk.java.net/~bpb/8032027/webrev.01/

I did not at this time change the algorithm to compute the reciprocal of the square root instead of the root directly as Andrew suggested. Apparently this would improve the rate of convergence from quadratic to cubic, but I am inclined to file this and the Karatsuba square root as two separate issues for future enhancement.

Likewise I did not yet include the special case which Joe mentioned for tuning performance for n < 2^1023 wherein the spread of unity bits is sufficiently small. If this does not make it into the current round of revisions a separate enhancement issue may likewise be filed.

Thanks,

Brian


More information about the core-libs-dev mailing list