20211002, 16:01  #1 
1976 Toyota Corona years forever!
"Wayne"
Nov 2006
Saskatchewan, Canada
11236_{8} Posts 
Is it feasible to define a simple P1 probability "approximator"?
I know there is a very robust accurate P1 probability calculator here.
But I'd like to find a simplified version that is still "pretty close"; and that can be used as a single formula or function. At first glance it does not seem like it should be very hard. There are only 4 variables:  Exponent  Current TF Bit level  Bound 1  Bound 2 However, it has eluded my synapses. I track all my P1 work for my Under2000 subproject in an Excel spread sheet (sorry, I'm a geek from the 80's). A big part of this project is determining whether is it more efficient to find the remining required factors with TF or with P1. (Or more accurately how much more of each and in what order?) Where I determine I need more P1, the bigger question is: "How much more?" Or more specifically what are the optimal bounds that will produce the desired number of factors with the least total work effort. My vision is to have a spreadsheet where I: (I actually already have this ... but step 2 below is inefficient and poorly done) 1. Download the current P1 work from here 2. Add a column with a "neat and tidy" P1 estimator formula for the current success rate. 3. Add another few columns with proposed bounds, success rates and work effort 4. Determine which new bounds will generate the required number of factors with the least total work effort. I can easily complete steps 1, 3 and 4. I just have not had any luck creating a useful simpler estimator. Thanks 
20211002, 16:31  #2 
Jun 2003
19×271 Posts 
You can write a macro for the full blown function in your spreadsheet tool of choice. Probably the easiest way (in the long run). The actual C code can be extracted from P95 source for reference.
Last fiddled with by axn on 20211002 at 16:32 
20211002, 17:04  #3  
1976 Toyota Corona years forever!
"Wayne"
Nov 2006
Saskatchewan, Canada
2·2,383 Posts 
Quote:
The problem I had then was being unable to (or not knowing how to) have the macro trigger for every row in the spreadsheet as soon as it was populated. Having to run it manually for every row (or at least every different row) was time consuming. 

20211003, 02:31  #4 
Jun 2003
12035_{8} Posts 
Write it as a function that takes all the 4 parameters and then returns a double. Then you just put it as a formula in a cell.
Are you using Excel (in Windows) or something else for your spreadsheet? 
20211003, 03:20  #5 
1976 Toyota Corona years forever!
"Wayne"
Nov 2006
Saskatchewan, Canada
11236_{8} Posts 

20211003, 03:42  #6 
Jun 2003
19×271 Posts 
Ok. So you need a .xslm file, where you insert a Module and define a public function.
Code:
Public Function Pminus1Probability(e as Long, tf as Integer, B1 as Long, B2 as Long) As Double 
20211003, 05:24  #7  
1976 Toyota Corona years forever!
"Wayne"
Nov 2006
Saskatchewan, Canada
129E_{16} Posts 
Quote:
Having looked at this source and after a few poor attempts at converting this version into a macro I've come to realize that for my purposes I don't need accuracy to many decimal points; 2 would be enough. That is why I'd be content with a much simpler "reasonable" formula. Thanks 

Thread Tools  
Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Is the "Combined" factoring probability actually wrong on mersenne.ca?  Zhangrc  mersenne.ca  16  20210616 02:47 
Is "mung" or "munged" a negative word in a moral sense?  Uncwilly  Lounge  15  20200414 18:35 
AouessareEl HaddouchiEssaaidi "test": "if Mp has no factor, it is prime!"  wildrabbitt  Miscellaneous Math  11  20150306 08:17 
How do conservatives define "victory in Iraq"?  cheesehead  Soap Box  3  20080915 12:12 
Would Minimizing "iterations between results file" may reveal "is not prime" earlier?  nitai1999  Software  7  20040826 18:12 