Torbjorn Granlund <t...@gmplib.org> writes: > ni...@lysator.liu.se (Niels Möller) writes: > > My bsqrt uses an iteration converging to a^{-1/2}, and broot uses an > iteration converging to a^{1/n - 1}. Both division free. > > So binv_sqroot (from mpn/generic/perfpow.c and your bsqrt seem to > compute the same function.
Do you think we should have an advertised binv_sqrt function returning a^{-1/2}? (And if so, should we have something analogous also for euclidean square root? And for nth roots?) My bsqrt first computes a^{-1/2}, but then it multiplies it by a before returning a^{1/2}. How do we make some progress here? I'm tempted to first commit my broot and corresponding test code (since that has less interface subtleties than bsqrt). > They should use mulmod_bnm1 rather than mullo for larger sizes, but they > currently don't. I haven't done any serious benchmarking. > > That's just like the perfpow.c functions, then. I do take some advantage of cancellation though. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance. _______________________________________________ gmp-devel mailing list gmp-devel@gmplib.org http://gmplib.org/mailman/listinfo/gmp-devel