Documentation

CslibFrontier.Algorithms.WordRAM.ThreeSum.ChanHe.CollisionTest

Native tests of the three Chan–He collision inequalities #

Each inequality multiplies a computed collision count by the number of candidate primes, then compares it with its supplied threshold. All multiplications, branches and flag updates are ordinary charged instructions. No predicate is executed by an oracle.

Main definitions #

Main results #

@[reducible, inline]

Number of candidate primes.

Threshold for one of the three sets.

@[reducible, inline]

Constant zero.

@[reducible, inline]

Collision count times the number of candidate primes.

@[reducible, inline]

Acceptance flag.

One charged multiplication and comparison, retaining a previously false flag.

Initialize a true flag and test all three supplied collision counts.

Test all three inequalities with a shared acceptance flag. The only written registers are scaled and good; memory and every other caller register are unchanged.