20180925, 11:27  #1 
May 2018
43 Posts 
Using work but with a fraction of the size
Hi all, I have a question about yafu. Is it possible to use the work option to say yafu that I have already done a certain tlevel, but using a fraction of the size of the number? Something like work_fraction 0.1 will mean, on a C130, work 13.
The reason to wanting this is that I want to test several numbers, that are in a file, with first of all plan light, and then something longer on the remaining numbers, but I do not want to redo the work I've already done. Thank you ! 
20180927, 14:26  #2  
"Ben"
Feb 2007
7041_{8} Posts 
Quote:
[edit] This could overtest some numbers, depending on the range of sizes in your file, but it is the cleanest way available to not redo work over a range of inputs. You could remove the smallest numbers from the file as work increases. pretest <num> will test the numbers up to t<num>, regardless of their size Next just use work <prevnum> pretest <newnum> Example: Code:
./yafu "factor(rsa(300))" pretest 20 v threads 8 <snip> >> fac: factoring 1570043679675205080620130669902055405981262411879929087672357832941249962339901412722872057 fac: using pretesting plan: normal fac: custom pretesting limit is: 20 fac: no tune info: using qs/gnfs crossover of 95 digits div: primes less than 10000 fmt: 1000000 iterations rho: x^2 + 3, starting 200 iterations on C91 rho: x^2 + 2, starting 200 iterations on C91 rho: x^2 + 1, starting 200 iterations on C91 pm1: starting B1 = 150K, B2 = gmpecm default on C91 fac: setting target pretesting digits to 20.00 fac: estimated sum of completed work is t0.00 fac: work done at B1=2000: 0 curves, max work = 30 curves fac: 30 more curves at B1=2000 needed to get to t20.00 ecm: 30/30 curves on C91, B1=2K, B2=gmpecm default fac: setting target pretesting digits to 20.00 t15: 1.00 t20: 0.04 fac: estimated sum of completed work is t15.18 fac: work done at B1=11000: 0 curves, max work = 74 curves fac: 72 more curves at B1=11000 needed to get to t20.00 ecm: 72/72 curves on C91, B1=11K, B2=gmpecm default fac: setting target pretesting digits to 20.00 t15: 7.00 t20: 1.01 t25: 0.05 fac: estimated sum of completed work is t20.24 Total factoring time = 2.0374 seconds Code:
./yafu "factor(input)" work 20 pretest 25 v threads 8 <snip> >> fac: factoring 1570043679675205080620130669902055405981262411879929087672357832941249962339901412722872057 fac: using pretesting plan: normal fac: custom pretesting limit is: 25 fac: no tune info: using qs/gnfs crossover of 95 digits fac: input indicated to have been pretested to t20.00 div: primes less than 10000 fmt: 1000000 iterations rho: x^2 + 3, starting 200 iterations on C91 rho: x^2 + 2, starting 200 iterations on C91 rho: x^2 + 1, starting 200 iterations on C91 fac: setting target pretesting digits to 25.00 t15: 6.31 t20: 1.05 t25: 0.05 fac: estimated sum of completed work is t20.26 fac: work done at B1=50000: 1 curves, max work = 214 curves fac: 204 more curves at B1=50000 needed to get to t25.00 ecm: 204/204 curves on C91, B1=50K, B2=gmpecm default, ETA: 0 sec fac: setting target pretesting digits to 25.00 t15: 35.45 t20: 10.76 t25: 1.01 t30: 0.06 fac: estimated sum of completed work is t25.32 Total factoring time = 4.4135 seconds Last fiddled with by bsquared on 20180927 at 14:38 

20180927, 16:39  #3 
May 2018
43 Posts 
Thank you, this is probably the most reasonable thing to do. What I wanted was something like doing plan light once for all numbers in a batch file, and then switching to plan normal for the remaining numbers, but of course without redoing what I've already done.
In any case using work I can more or less obtain the same result. 
20180927, 17:40  #4  
"Ben"
Feb 2007
3,617 Posts 
Quote:
In driver.c, in the applyOpt function, case 58 (near line 2315), allow for a user to input the string "light", "normal", or "deep" (the plan options), in addition to the usual numeric input. "custom" could probably also be accommodated by allowing the input of a number less than 1. In factor_common.c, function init_factor_work, just before the if/else branching near line 2030, check to see if initial_work is equal to whatever special values were selected for that purpose in applyOpt, if the plan strings were input. init_factor_work knows the size of the current input, so initial_work could be changed at that point to the value that would have been the final result of the indicated plan. Example: "work light" would put the value 1 (or whatever) into autofact_obj.initial_work. init_factor_work would then see that initial_work == 1, and change it to be autofact_obj.initial_work = 2/9 * size(input) The rest of the code proceeds as normal. if initial work is a number between 0 and 1, use that as an indication of a custom plan. Work levels between 0 or 1 would not otherwise ever occur, so that should be ok. 

20180927, 17:58  #5  
"Ben"
Feb 2007
3,617 Posts 
Quote:
if (autofact_obj.initial_work < 1.0) autofact_obj.initial_work = autofact_obj.initial_work * fobj>digits 

20181003, 16:16  #6 
"Ben"
Feb 2007
111000100001_{2} Posts 
Well, it was slightly harder than I first thought. Justupdated SVN 376 in branches/wip has this new functionality.
Code:
+ interpret values less than 1.0 to command line option work to mean a scaling of the input number (tested to work with single and batchfile inputs) 
20181004, 09:25  #7 
May 2018
43 Posts 
Thank you!

20181004, 10:29  #8 
Romulan Interpreter
"name field"
Jun 2011
Thailand
9963_{10} Posts 
Isn't that the same as just doing plan=normal, and avoid all the headache, as long as ecm exits when a factor is found? Sorry but I still do not get it where is the advantage.

Thread Tools  
Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
An Egyptian Fraction  Yamato  Puzzles  8  20130516 15:50 
How important is L2 cache size for LL work?  stars10250  Hardware  5  20120219 18:32 
Continued Fraction Algorithm  Raman  Math  7  20090227 18:01 
Partial fraction of this expression?please!!  tinhnho  Miscellaneous Math  4  20050117 19:45 
Continued Fraction of Primes  Cyclamen Persicum  Miscellaneous Math  9  20030413 14:56 