![]() |
![]() |
#1 |
1976 Toyota Corona years forever!
"Wayne"
Nov 2006
Saskatchewan, Canada
143D16 Posts |
![]()
I know there is a very robust accurate P-1 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 Under-2000 sub-project 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 P-1. (Or more accurately how much more of each and in what order?) Where I determine I need more P-1, 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 P-1 work from here 2. Add a column with a "neat and tidy" P-1 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 |
![]() |
![]() |
![]() |
#2 |
Jun 2003
23×233 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 2021-10-02 at 16:32 |
![]() |
![]() |
![]() |
#3 | |
1976 Toyota Corona years forever!
"Wayne"
Nov 2006
Saskatchewan, Canada
3·11·157 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. |
|
![]() |
![]() |
![]() |
#4 |
Jun 2003
23×233 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? |
![]() |
![]() |
![]() |
#5 |
1976 Toyota Corona years forever!
"Wayne"
Nov 2006
Saskatchewan, Canada
3×11×157 Posts |
![]() |
![]() |
![]() |
![]() |
#6 |
Jun 2003
23×233 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 |
![]() |
![]() |
![]() |
#7 | |
1976 Toyota Corona years forever!
"Wayne"
Nov 2006
Saskatchewan, Canada
143D16 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 | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Is the "Combined" factoring probability actually wrong on mersenne.ca? | Zhangrc | mersenne.ca | 16 | 2021-06-16 02:47 |
Is "mung" or "munged" a negative word in a moral sense? | Uncwilly | Lounge | 15 | 2020-04-14 18:35 |
Aouessare-El Haddouchi-Essaaidi "test": "if Mp has no factor, it is prime!" | wildrabbitt | Miscellaneous Math | 11 | 2015-03-06 08:17 |
How do conservatives define "victory in Iraq"? | cheesehead | Soap Box | 3 | 2008-09-15 12:12 |
Would Minimizing "iterations between results file" may reveal "is not prime" earlier? | nitai1999 | Software | 7 | 2004-08-26 18:12 |