mersenneforum.org  

Go Back   mersenneforum.org > Factoring Projects > YAFU

Reply
 
Thread Tools
Old 2010-04-19, 05:35   #364
Batalov
 
Batalov's Avatar
 
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2

932410 Posts
Default

The new binary nailed all three. Thanks!

In the end, when all factors are reported, the binary lingers for a second and then says
>> couldn't reallocate string when parsing
Exit 255

It doesn't hurt (really), but what is it doing for that second?
The command-line is
# echo "siqs(732566077883908909845195639793682175206731)" | yafu -v

Doesn't seem to "freeze" without -v.
Batalov is offline   Reply With Quote
Old 2010-04-19, 07:42   #365
xilman
Bamboozled!
 
xilman's Avatar
 
"π’‰Ίπ’ŒŒπ’‡·π’†·π’€­"
May 2003
Down not across

245338 Posts
Default

Quote:
Originally Posted by bsquared View Post
Who knew that the ultimate question to the ultimate answer was "what size composite integer places excessive stress on yafu's hack of a random number generator?"? Only for 64 bit systems is this a problem, where I put some garbage together to try to extend rand() to produce a 64 bit random number rather than the 16 bit default.
If you want a cheap and cheerful 64-bit PRNG I recommend the MMIX LCG:
Code:
x[i+1] = (6364136223846793005*x[i] + 1442695040888963407) mod 2^64
If you want a good generator you need to do a bit more research.


Paul
xilman is online now   Reply With Quote
Old 2010-04-19, 13:56   #366
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

3,371 Posts
Default

Quote:
Originally Posted by Batalov View Post
The new binary nailed all three. Thanks!

In the end, when all factors are reported, the binary lingers for a second and then says
>> couldn't reallocate string when parsing
Exit 255

It doesn't hurt (really), but what is it doing for that second?
Putting in a few cycles on computing the Ultimate Question, of course .


Quote:
Originally Posted by Batalov View Post
The command-line is
# echo "siqs(732566077883908909845195639793682175206731)" | yafu -v

Doesn't seem to "freeze" without -v.
On a more serious note, would you be upset to learn that it was stuck in a loop allocating more memory for a string? malloc eventually returns NULL, at which point the program notices and exits.

Everything works fine without the -v because the program is able to determine that there is something in the pipe, processes it, and exits. It gets confused with the -v because there is both something in the pipe and an input argument which causes it to open in interpreter mode. There is apparently a neverending stream of stuff coming out of an open pipe... .

A workaround until I can fix this is to just use yafu "siqs(732566077883908909845195639793682175206731)" -v, or use echo but put the v in the .ini file.

apologies,
- b.
bsquared is online now   Reply With Quote
Old 2010-04-19, 14:00   #367
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

3,371 Posts
Default

Quote:
Originally Posted by xilman View Post
If you want a cheap and cheerful 64-bit PRNG I recommend the MMIX LCG:
Code:
x[i+1] = (6364136223846793005*x[i] + 1442695040888963407) mod 2^64
If you want a good generator you need to do a bit more research.


Paul
Such as this?
bsquared is online now   Reply With Quote
Old 2010-04-19, 15:36   #368
xilman
Bamboozled!
 
xilman's Avatar
 
"π’‰Ίπ’ŒŒπ’‡·π’†·π’€­"
May 2003
Down not across

3·3,529 Posts
Default

Quote:
Originally Posted by bsquared View Post
Such as this?
Sure, if it meets your requirements. I don't know what "good" means in your context.

Until you know your requirements (speed, cycle length, cryptographic strength, code complexity, sundry statistical properties, etc) it is difficult to give advice other than to conduct research.

The 3rd Edition of Numerical Recipes has some nice proposals for non-cryptographic PRNGs.

My guess is that the MMIX may be sufficient for what you want, which is why I proposed it. It is certainly very quick to write and to run as it consists of two simple arithmetic operations on a 64-bit variable. It's what I use all the time when I can't justify anything more complex.

Paul

Last fiddled with by xilman on 2010-04-19 at 15:39 Reason: Add final paragraph.
xilman is online now   Reply With Quote
Old 2010-04-19, 17:22   #369
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

1101001010112 Posts
Default

Quote:
Originally Posted by xilman View Post
Sure, if it meets your requirements. I don't know what "good" means in your context.

That's a good question; me neither, really. Random numbers are used in many places throughout the code, but mostly for non-critical things like generating random ECM curve sigmas and random factor base indices from which SIQS polynomials are built, that sort of thing. MMIX, I'm sure, would be fine for those.

The only "mission critical" application from a RNG standpoint that I can think of is the RSA number generation function. But I've never meant that to be targeted for cryptographic use - only for generating test cases for siqs and other factoring routines.

Quote:
Originally Posted by xilman View Post
It's what I use all the time when I can't justify anything more complex.

Paul
Sounds a lot like my situation.

Thanks!
- ben.
bsquared is online now   Reply With Quote
Old 2010-05-25, 06:32   #370
jrk
 
jrk's Avatar
 
May 2008

100010001112 Posts
Default

Quote:
Originally Posted by bsquared View Post
Quote:
Originally Posted by xilman View Post
If you want a cheap and cheerful 64-bit PRNG I recommend the MMIX LCG:
Code:
x[i+1] = (6364136223846793005*x[i] + 1442695040888963407) mod 2^64
If you want a good generator you need to do a bit more research.


Paul
Such as this?
Or this?
jrk is offline   Reply With Quote
Old 2010-06-01, 15:25   #371
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

3,371 Posts
Default

Quote:
Originally Posted by jrk View Post
Or this?
Thanks! I hadn't seen that before.
bsquared is online now   Reply With Quote
Old 2010-06-11, 10:38   #372
kar_bon
 
kar_bon's Avatar
 
Mar 2006
Germany

132·17 Posts
Default

Suggestion:

The output from yafu V1.18 in a DOS-box gives the length of the candidate like
rho: ... on C99
pp1: ... on C99
ecm: ... on C99 ...

but the file 'factor.log' only prints this in bit-size!

So could you equalize both outputs? I like the Cxx more.
kar_bon is offline   Reply With Quote
Old 2010-06-11, 13:11   #373
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

3,371 Posts
Default

Quote:
Originally Posted by kar_bon View Post
Suggestion:

The output from yafu V1.18 in a DOS-box gives the length of the candidate like
rho: ... on C99
pp1: ... on C99
ecm: ... on C99 ...

but the file 'factor.log' only prints this in bit-size!

So could you equalize both outputs? I like the Cxx more.
Sure, thanks for the suggestion.
bsquared is online now   Reply With Quote
Old 2010-07-29, 14:49   #374
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

3,371 Posts
Default YAFU 1.19 available

... in the usual place.

New in version 1.19

+ much improved sieve of Eratosthenes
+ faster prime counting (fastest available on modern 64 bit CPUs in some situations)
+ higher limit (up to 4e18)
+ less memory usage
+ some new flags for printing primes.
+ slightly faster SQUFOF implementation
+ bugfixes
+ misc requested changes
+ addition of fermat's factorization algorithm

For this version I again mostly concentrated on the sieve of Eratosthenes. Also the usual bug fixes and requested changes. Any feedback is welcome.
bsquared is online now   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Running YAFU via Aliqueit doesn't find yafu.ini EdH YAFU 8 2018-03-14 17:22
YAFU-1.34 bsquared YAFU 119 2015-11-05 16:24
Yafu bug. storflyt32 YAFU 2 2015-06-29 05:19
yafu-1.33 bsquared YAFU 12 2012-11-08 04:12
yafu-1.32.1 bsquared YAFU 21 2012-09-04 19:44

All times are UTC. The time now is 20:16.

Thu Feb 25 20:16:54 UTC 2021 up 84 days, 16:28, 1 user, load averages: 2.74, 2.11, 1.94

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.