Post Reply 
Existing CAS commands --> Prime discussion
07-10-2017, 08:46 AM
Post: #11
RE: Existing CAS commands --> Prime discussion
(06-28-2017 08:40 AM)parisse Wrote:  isprime on the Prime returns 1 if the number is pseudoprime, it is not a proof of primality (except for "small" numbers) and there is nothing on the Prime to return a certificate of primality.

About roots: most of the time, proot will return accurate roots, but it may fail for very specific polynomials that have two roots almost identical (and zeros will almost never be able to return exact roots).
Classical example is Mignotte polynomial
mig(n,t):=x^n-((2^(t/2)-1)*x-1)^2
For example mig(257,14)==x^257-(127*x-1)^2 has two roots near 1/127.
realroot finds these roots with precision 1e-15 in about 0.03s on my computer, proot requires more than 6s (of course it also computes complex roots).

ok got it. That means we would need both the isPrime and isPseudoprime functionality from Giac/Xcas to ensure we can make a distinction between true prime functionality and pseudo prime. This would also mean you need to allow the user to press stop to halt the calculator if isPrime take too long time to finish the true prime test. could be done as one function isPrime with a parameter to specific if you are looking for turn prime or pseudo prime (1/0).

Understand the distinction between the algoritms used for roots better now.
So we need to cover zeros, proot and realroot (including their complex root counterparts) to ensure we can cover all root corner cases, BUT we need to have really great documentation to explain when to use what algorithm to cover all cases.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Existing CAS commands --> Prime discussion - Anders - 07-10-2017 08:46 AM



User(s) browsing this thread: 6 Guest(s)