Re: 3^k performance

Karim Belabas <[email protected]>
Newsgroups gmane.comp.mathematics.pari.devel
Message-ID <[email protected]>
* Bill Allombert [2022-11-26 09:47]:
[...]
> The simplest approach would be to use powers(3,10^5), with to caveat:
[...]
> - the powers function has a bug and is very slow for integers.
[...]

Here's a temporary workaround.

\\ slow
(12:16) gp > v=powers(3,10^5);
time = 2,191 ms.
\\ reasonably fast
(12:16) gp > w=powers(3,10^5,1);
time = 345 ms.

(12:16) gp > v==w
%3 = 1 \\ identical

Will investigate later.

Cheers,

    K.B.
--
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/
`
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.