Skip to content

Commit f6bade8

Browse files
Update heuristic scaling
1 parent 31391fd commit f6bade8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

FindAFactor/_find_a_factor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1126,7 +1126,7 @@ std::string find_a_factor(std::string toFactorStr, size_t method, size_t nodeCou
11261126
// This level default (scaling) was suggested by Elara (OpenAI GPT).
11271127
const double N = sqrtN.convert_to<double>();
11281128
const double logN = log(N);
1129-
const BigInteger primeCeilingBigInt = (BigInteger)(smoothnessBoundMultiplier * pow(exp(0.5 * std::sqrt(logN * log(logN))) + 0.5, sqrt(2) / 4));
1129+
const BigInteger primeCeilingBigInt = (BigInteger)(smoothnessBoundMultiplier * pow(exp(0.5 * std::sqrt(logN * log(logN))) + 0.5, std::sqrt(2.0) / 4));
11301130
const size_t primeCeiling = (size_t)primeCeilingBigInt;
11311131
if (((BigInteger)primeCeiling) != primeCeilingBigInt) {
11321132
throw std::runtime_error("Your primes are out of size_t range! (Your formula smoothness bound calculates to be " + boost::lexical_cast<std::string>(primeCeilingBigInt) + ".) Consider lowering your smoothness bound, since it's unlikely you want to sieve for primes above 2 to the 64th power, but, if so, you can modify the SieveOfEratosthenes() code slightly to allow for this.");

0 commit comments

Comments
 (0)