mersenneforum.org  

Go Back   mersenneforum.org > Math Stuff > Computer Science & Computational Number Theory > PARI/GP

Reply
 
Thread Tools
Old 2010-08-11, 19:37   #276
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

135338 Posts
Default

Glad to hear about the addhelp. It will, uh, help in the future.

Quote:
Originally Posted by 3.14159 View Post
isSPRP? Isn't the meaning a bit self-evident there?
Your function isSPRP as described in post #270 is not the indicator function for the strong probable primes, as the name would suggest. Instead it is a probable-prime test incorporating the strong test and trial divison. Your function isPRP as listed in post #252 does not check if a number is a probable prime, as the name suggests, but instead checks if the number is a strong probable prime.

Last fiddled with by CRGreathouse on 2010-08-11 at 19:41
CRGreathouse is offline   Reply With Quote
Old 2010-08-11, 21:00   #277
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

24·3·5·7 Posts
Default

Quote:
Originally Posted by CRGreathouse
Your function isSPRP as described in post #270 is not the indicator function for the strong probable primes, as the name would suggest. Instead it is a probable-prime test incorporating the strong test and trial divison. Your function isPRP as listed in post #252 does not check if a number is a probable prime, as the name suggests, but instead checks if the number is a strong probable prime.
The help addition solves all. The name of the file I saved all the definitions of the functions to is named b(m).txt, and is indeed a text file.

Last fiddled with by 3.14159 on 2010-08-11 at 21:00
3.14159 is offline   Reply With Quote
Old 2010-08-11, 21:13   #278
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
so the basic idea I have of the process required is:

1)read for updates
2)send request to next part of script
3)find function names that can be understood in the text (if none exist give error and/or print questions the script has about the request)
4)print out code for functions if they are found to be in the database.
5) post code to Mersenne forums website.
instead of finding function names it's easier to find function descriptions(aka. addhelp()) in a post.

so for example if someone asks to find the first n Mersenne Numbers

in Mersenne(n) lets say the addhelp contains first n Mersenne Numbers

theres a match found it know that's the one it should print.

now they may use any variable so I wonder if we can say don't check for n check for anything in this position relative to the first part of this string. would this help to decipher? the hard part is we may need a lot of / or saying switch this synonyms addhelp from this term to this other set of them is there a way ?

Last fiddled with by science_man_88 on 2010-08-11 at 21:16
science_man_88 is offline   Reply With Quote
Old 2010-08-11, 21:26   #279
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

10111010110112 Posts
Default

Quote:
Originally Posted by 3.14159 View Post
The help addition solves all. The name of the file I saved all the definitions of the functions to is named b(m).txt, and is indeed a text file.
Yep. I have at least one deceptive name amongst my functions: DickmanRho estimates, rather than computes, Dickman's rho.
Code:
>?DickmanRho
Estimates the value of the Dickman rho function. For x <= 3 the exact values 
are used, up to rounding; up to 15 the value is interpolated using known values 
and rhoest; after 15 rhoest is used, along with a correction factor based on 
the last value in rhoTable.

>?rhoest 
de Bruijn's asymptotic approximation for rho(x), rewritten as in van de Lune 
and Wattel 1969. Curiously, their paper shows values for this estimate that 
differ from those calculated by this function, often as soon as the second 
decimal place -- but as the difference is in the direction of the true value, I 
have not looked further into this.
CRGreathouse is offline   Reply With Quote
Old 2010-08-11, 21:29   #280
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3×1,993 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
instead of finding function names it's easier to find function descriptions(aka. addhelp()) in a post.
Sure, but there are lots of ways to say things. You don't want the total size of your addhelp files to be 10^23 bytes, do you?

Quote:
Originally Posted by science_man_88 View Post
now they may use any variable so I wonder if we can say don't check for n check for anything in this position relative to the first part of this string. would this help to decipher? the hard part is we may need a lot of / or saying switch this synonyms addhelp from this term to this other set of them is there a way ?
It's a rather hard problem, and I do wish you luck. Synonym tables seem like a fair place to start.

Frankly, Perl would probably be better suited to this task than Pari -- Pari is bad at text processing, and that's where Perl shines.
CRGreathouse is offline   Reply With Quote
Old 2010-08-11, 21:34   #281
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

how could you make a synoym table in pari ? I know for a function I do function1 = function2 but how do can i do it for addhelp technically it could be more than one help file if i can call more than one. how can I make a synonym table for changing one or 2 words in a addhelp if we go for short names.
science_man_88 is offline   Reply With Quote
Old 2010-08-11, 21:40   #282
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3·1,993 Posts
Default

There's no special way to do that. And given how painful string operations are in Pari, I wouldn't recommend doing them at all if you can avoid it.
CRGreathouse is offline   Reply With Quote
Old 2010-08-11, 21:41   #283
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

100000110000002 Posts
Default

Code:
addhelp(fun,Vec(?foo) - "foo." + "fun.")
I tried something like that.

Code:
(18:38) gp > ?foo
a function called foo.

Last fiddled with by science_man_88 on 2010-08-11 at 21:44
science_man_88 is offline   Reply With Quote
Old 2010-08-11, 21:48   #284
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

another thing I thought of can we use function1=function2 so it writes the function name without _ in each addhelp ?
science_man_88 is offline   Reply With Quote
Old 2010-08-11, 22:41   #285
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

If Perl is a way to do this then use it at least up to printing the functions have the Perl executable pass pari the function names to print out maybe or maybe the Perl program can read the script file(s) involved and print it to a command prompt. the point is it's useful. if a Perl expert can give us code similar to C maybe we can convert to Pari later on.
science_man_88 is offline   Reply With Quote
Old 2010-08-11, 23:17   #286
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

could we not make the read post into a vector of strings then sort from most important to least important according to a list/vector ?

oh by the way i found a typo in ?vecsort fonction-> function if I know what I'm talking about.

Last fiddled with by science_man_88 on 2010-08-11 at 23:18
science_man_88 is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why do I sometimes see all the <> formatting commands when I quote or edit? cheesehead Forum Feedback 3 2013-05-25 12:56
Passing commands to PARI on Windows James Heinrich Software 2 2012-05-13 19:19
Ubiquity commands Mini-Geek Aliquot Sequences 1 2009-09-22 19:33
64-bit Pari? CRGreathouse Software 2 2009-03-13 04:22
Are these commands correct? jasong Linux 2 2007-10-18 23:40

All times are UTC. The time now is 22:21.


Fri Aug 6 22:21:50 UTC 2021 up 14 days, 16:50, 1 user, load averages: 2.81, 3.24, 3.15

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.