Improve by-divisor residue reuse and fix Montgomery mul

This commit is contained in:
Marek Lemańczyk committed 2025-09-24 15:44:21 +02:00
1 parent 82a0fb1dd7
commit df69dcbadb
3 files changed
+190 -97

No files matched your search

+10 -1
View File
@@ -813,7 +813,16 @@ internal static class Program
return;
}
states.Sort((left, right) => left.AllowedMax.CompareTo(right.AllowedMax));
states.Sort(static (left, right) =>
{
int compare = left.AllowedMax.CompareTo(right.AllowedMax);
if (compare != 0)
{
return compare;
}
return left.Prime.CompareTo(right.Prime);
});
int stateCount = states.Count;
ulong[] primeValues = new ulong[stateCount];