octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #61312] Extending isprime() with Miller-Rabin


From: Arun Giridhar
Subject: [Octave-bug-tracker] [bug #61312] Extending isprime() with Miller-Rabin test
Date: Mon, 18 Oct 2021 18:30:22 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:93.0) Gecko/20100101 Firefox/93.0

Follow-up Comment #16, bug #61312 (project octave):

Patch 11 attached with the following changes:

1. Tuned value of the transition in isprime.m from division to Miller-Rabin.
This had to be empirical, so I've added a FIXME to that part of isprime.m
explaining how. The tuned value is 380e9 == 3.8e11. I found the casting from
double to uint32 etc was slower than simply using double, so I've removed the
casts for m and x. Please check for performance regressions.

2. Edited NEWS in view of the performance differences between old and new for
small and big.

3. Optimizations to Schrage based on empirical testing. Alternatives tried
before converging: the code in comment #14, various combinations and sequences
for the opening code (if-else vs ternary operators), and whether to swap a and
b or whether to call the function with a and b already ordered. The
differences between them were minor though, compared to earlier patches.

Patch 11 attached.

(file #52122)
    _______________________________________________________

Additional Item Attachment:

File name: patch11.patch                  Size:13 KB
    <https://file.savannah.gnu.org/file/patch11.patch?file_id=52122>



    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]