[bug #68459] Optimize "__isprimelarge__.cc" on systems with native 128-bit arithmetics

"Dmitri A. Sergatskov" <[email protected]> Thu, 18 Jun 2026 16:46:24 -0400 (EDT)
Newsgroups gmane.comp.gnu.octave.bugs
Message-ID <[email protected]>
Please use the bug tracker to post updates to a bug report.  The mailing list is intended as a read-only notification stream.  Info posted to this mailing list address won't appear in the tracker database where it is most useful.

Follow-up Comment #1, bug #68459 (group octave):

CSET is attached. 
(file bug68459_isprimelarge_20260618_100.cset)
Some benchmarks on Intel Ultra9 285 (Fedora linux; gcc 16.1.1)
Before:

octave:1> n = uint64 (2305843009213690000) + uint64 (1:1e6);
octave:2> tic; isprime (n); toc
Elapsed time is 2.20224 seconds.
octave:3> n = uint64 (1084978968791);
octave:4> tic; m = factor (n); toc
Elapsed time is 0.104714 seconds.
octave:5> 


After:

octave:1> n = uint64 (2305843009213690000) + uint64 (1:1e6);
octave:2> tic; isprime (n); toc
Elapsed time is 0.213766 seconds.
octave:3> n = uint64 (1084978968791);
octave:4> tic; m = factor (n); toc
Elapsed time is 0.066196 seconds.


Dmitri.
-- 


(file #58731)

    _______________________________________________________

Additional Item Attachment:

Name: bug68459_isprimelarge_20260618_100.cset Size: 1.8KiB

<https://file.savannah.gnu.org/file/bug68459_isprimelarge_20260618_100.cset?file_id=58731>


    AGPL NOTICE

These attachments are served by Savane. You can download the corresponding
source code of Savane at
https://savannah.gnu.org/source/savane-c36938be85ff6c1b727bc7dd7fd30e48f9142870.tar.gz


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?68459>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc (application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE-----

iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCajRZHwAKCRCqLAuaBUf3
TmXsAQDzSYOw0M8LtrPKQxs0IQWXH3hH0nRCzqXyClPijm0p8wEAiGuqyO724g/4
LzHG3WJW+gFAPwL6eJy4MrkQP1hHFQY=
=9UrW
-----END PGP SIGNATURE-----