mersenneforum.org  

Go Back   mersenneforum.org > Factoring Projects > Factoring

Reply
 
Thread Tools
Old 2021-10-02, 16:01   #1
petrw1
1976 Toyota Corona years forever!
 
petrw1's Avatar
 
"Wayne"
Nov 2006
Saskatchewan, Canada

10010111001002 Posts
Default Is it feasible to define a simple P-1 probability "approximator"?

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
petrw1 is offline   Reply With Quote
Old 2021-10-02, 16:31   #2
axn
 
axn's Avatar
 
Jun 2003

5,179 Posts
Default

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
axn is offline   Reply With Quote
Old 2021-10-02, 17:04   #3
petrw1
1976 Toyota Corona years forever!
 
petrw1's Avatar
 
"Wayne"
Nov 2006
Saskatchewan, Canada

10010111001002 Posts
Default

Quote:
Originally Posted by axn View Post
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.
Thanks...I did that for the prior version.

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.
petrw1 is offline   Reply With Quote
Old 2021-10-03, 02:31   #4
axn
 
axn's Avatar
 
Jun 2003

5,179 Posts
Default

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?
axn is offline   Reply With Quote
Old 2021-10-03, 03:20   #5
petrw1
1976 Toyota Corona years forever!
 
petrw1's Avatar
 
"Wayne"
Nov 2006
Saskatchewan, Canada

12E416 Posts
Default

Quote:
Originally Posted by axn View Post
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.
That's exactly what I am trying to do .

Quote:
Are you using Excel (in Windows) or something else for your spreadsheet?
Yes
petrw1 is offline   Reply With Quote
Old 2021-10-03, 03:42   #6
axn
 
axn's Avatar
 
Jun 2003

5,179 Posts
Default

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
and then put a formula in the cell as, for example, =Pminus1Probability(A1, B1, C1, D1)
axn is offline   Reply With Quote
Old 2021-10-03, 05:24   #7
petrw1
1976 Toyota Corona years forever!
 
petrw1's Avatar
 
"Wayne"
Nov 2006
Saskatchewan, Canada

113448 Posts
Default

Quote:
Originally Posted by axn View Post
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
and then put a formula in the cell as, for example, =Pminus1Probability(A1, B1, C1, D1)
Yes, I understand the process...my problem is converting this into an excel Function/macro.

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
petrw1 is offline   Reply With Quote
Reply

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 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

All times are UTC. The time now is 06:00.


Mon Nov 29 06:00:59 UTC 2021 up 129 days, 29 mins, 0 users, load averages: 1.45, 1.15, 1.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.