Karim Belabas on Wed, 25 Oct 2023 10:27:31 +0200
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: Polynomials with integer roots
|
- To: Gordon Royle <gordon.royle@uwa.edu.au>
- Subject: Re: Polynomials with integer roots
- From: Karim Belabas <Karim.Belabas@u-bordeaux.fr>
- Date: Wed, 25 Oct 2023 10:27:03 +0200
- Arc-authentication-results: i=1; smail; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; d=math.u-bordeaux.fr; s=openarc; t=1698222425; c=relaxed/relaxed; bh=vAGdtHPxjISGQoAWeEBgHep+4JEun/0cc6rBHyOTIYU=; h=Date:From:To:Cc:Subject:Message-ID:Mail-Followup-To:References: MIME-Version:Content-Type:Content-Disposition: Content-Transfer-Encoding:In-Reply-To; b=Ci0mG10PnfNRs1O75IcomQDHCqMSmcwL4XLsjeC5vX5+RYGBLTaxNz/gcNGLYw4925iFMaEk3GK418GWwisSmc9kEj2rCLVFU92P9rElmHzFe6R6NLJkNYAhZ3CtVcp7WIt7PJnzBrJQlWk39ogdX1TF5FhrWzS3JsSOWyti8ovCL9qr9TbyZIxdTt7cYjhJIfwk3AdtmHgPCQlkIsP11Z4rz9VzJy/PZmfZmroS+z0Oe5QCseFXluPv0E4KvaMNDYreP4/7hEd22bpSybaYKst1GS4eqBA32FrYbJGMJBP53oFY58M9yAH/PoMdtjuafCmvpYWlsQ78Gq8bMfYx0vRNMRbiMG0k26q665BMcrc0BZNqHG2D27wry1DwUATFv/aU5eha8a7yHt+DODsmNY4cKh1P06xLmmx7Io4OWwRZhqnwOaDDjBp3GFUNcF+0Ow3BLLwlMyhHK/pNCKYw42WEO4pFm+jG1HtHE+sd0L5/nEVA1cKIE1MBpS1dbX3UCCCOn6jcXE8dQ6Q4rdv+hDvrNild93vkKORQm2EFN9Bz0pBdGPVLiJelmVYihXjqfV2F7x+6Mn2HqPXLDUPV0X3mZ03PIkeBpJWjS7dUcWxPpXCTD31YpKmVGPX0iGq+GD6uKEhahcuofYqeq52FjA9tvY3kCSdPVM8/EdEJdf0=
- Arc-seal: i=1; a=rsa-sha256; d=math.u-bordeaux.fr; s=openarc; t=1698222425; cv=none; b=ei8exqOyQRtj9wSRovyR95wYwq/zATO52CIKtH01YZAaKHMhWWUIZP47hE0o7odZBwbTrvU8CTiY7T/OfFZS4q/Aes4jsxFayRd9JfmoiBAGTzZi1XG+KOYG5woEMi2HMyH7rGrrHeMQ+ffxKPaoXpAYx/SyN+retAeqpHJy0pUhEmXAJGUi8NpwWdX6hRV2ZYzOGdNs+YoAEG78S76bAJjIDqDqZ71+CNR/wcFGSff5I4hv/grpuesf7UudUX/7lE79o6GwPdXo7EURM/4jzy0xWd8ypOit34keFLqKEt6pjGnr+Cc5DvpHbpVLVDqQbpuZR5lWDjmOMjZmONPUg1EWrMK5ViTUQ6VoDNyiP3L0oEa/P+pi1YfyIJi7c6CuhMBi1s5r2cQdkttBJjpmHZY9N3R5BW2+lMBdsYbojfi2qxBv4CpQDZ0AvTVLs+suqwhl6NOcwv1tUo8fIFXnTgXn/Me3FGknB90YLucdc+4h201Fy5y8UN8avFnrjPvhyHd5bKVk4KftB/iGb/QELeM7ZSBJK2EkuuTPOwQLNS8iovtcF3GpLxiodhwU3s1NdRsVya5xL/m5OZt/9DLzzLOco374fAjZlwoBcQr0h+3/4DrY+PqdaDZ4NYYedjHoDgeph4koyYw21xBTxZXIn7Y7UZKfxW7Ec+fWLRyOOgQ=
- Authentication-results: smail; dmarc=none header.from=u-bordeaux.fr
- Authentication-results: smail; arc=none
- Cc: "pari-users@pari.math.u-bordeaux.fr" <pari-users@pari.math.u-bordeaux.fr>
- Delivery-date: Wed, 25 Oct 2023 10:27:31 +0200
- In-reply-to: <MEYPR01MB7087A095EFA3015D0BA6CDF8A5DEA@MEYPR01MB7087.ausprd01.prod.outlook.com>
- Mail-followup-to: Gordon Royle <gordon.royle@uwa.edu.au>, "pari-users@pari.math.u-bordeaux.fr" <pari-users@pari.math.u-bordeaux.fr>
- References: <MEYPR01MB7087A095EFA3015D0BA6CDF8A5DEA@MEYPR01MB7087.ausprd01.prod.outlook.com>
* Gordon Royle [2023-10-25 08:14]:
> Hi Pari/GP ers
>
> Suppose that I have billions of polynomials of degree around 10 with integer coefficients of modest size.
>
> I want to find the tiny number, if any, that have all integer roots.
>
> What is the fastest way to do this in gp ?
Say the list is contained in vector L. Here's the simplest way.
[ T | T <- L, #nfroots(,T) == poldegree(T) ]
There are ways to do it faster in library mode by cloning a few private
functions around DDF_roots() and having them abort as soon as the
polynomial is not totally split modulo some small prime p [when
Flx_nbroots in pick_prime() returns a lower value than the degree].
I guess trying to replicate that in gp will slow down the program rather
than speed it up... You might still want to experiment with
install(Flx_nbroots, GU); \\ once
Flx_nbroots(T, p) == poldegree(T)
where p is in a small list of primes. (Without installing functions,
you'll have to use factormod(T, p, 1) which will be slower.)
If you can organize you work that way, it will be more efficient to weed
out polynomials as soon as they are produced rather than store them in a
huge list.
Cheers,
K.B.
--
Pr. Karim Belabas, U. Bordeaux, Vice-président en charge du Numérique
Institut de Mathématiques de Bordeaux UMR 5251 - (+33) 05 40 00 29 77
http://www.math.u-bordeaux.fr/~kbelabas/