mpn_rootrem

Paul Zimmermann Paul.Zimmermann at loria.fr
Wed Sep 29 09:13:54 CEST 2010


       Torbjörn,

thank you for the quick answer.

> There are plans to document (some form of) mpn_rootrem.  There are plans
> to rewrite mpn_sqrtrem to use a different algorithm, computing sqrt(A)
> as sqrt(1/A)*A, since the Newton iteration for 1/A is division-free.

good. I'm not sure the division-free algorithm will win, especially if you
use mpn_div_q instead of mpn_divrem in the final division of mpn_sqrtrem,
when the remainder is not needed, and avoid the mpn_sqr call. But only trying
both variants can tell.

> I realise that this is not an ideal reply; perhaps we should be less
> conservative about documenting mpn functions that we are.  The reasoning
> behind our current policy is that we want the interfaces to mature, to
> avoid ending up in a situation where we need to support multiple
> interfaces.

how do you plan to change the mpn_rootrem API, if any? I find the current API
very nice (at least for our use within MPFR) and very consistent with that of
mpn_sqrtrem.

Paul


More information about the gmp-devel mailing list