Changeset 1596


Ignore:
Timestamp:
Jun 7, 2010, 12:53:42 PM (11 years ago)
Author:
Sven Rech
Message:

much better time approximation for quadratic sieve

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/QuadraticSieve/QuadraticSieve.cs

    r1593 r1596  
    539539        {
    540540            TimeSpan diff = DateTime.Now - start_sieving_time;
    541             double msleft = (diff.TotalMilliseconds / (num_relations - start_relations)) * (max_relations - num_relations);
     541            double a = -3.55504;
     542            double b = 8.62296;
     543            double c = -7.75103;
     544            double d = 3.65871;
     545            double x = (double)num_relations / max_relations;
     546            double progress = a * x*x*x*x + b * x*x*x + c * x*x + d * x;
     547            double totalTime = diff.TotalMilliseconds / progress;
     548            double msleft = totalTime - diff.TotalMilliseconds;
     549            //double msleft = (diff.TotalMilliseconds / (num_relations - start_relations)) * (max_relations - num_relations);
    542550            if (msleft > 0 && !double.IsInfinity(msleft))
    543551            {
Note: See TracChangeset for help on using the changeset viewer.