anchor.diff:  
   initialization
     Two := 2;
  +  DeterminicityThreshold := UInt64(341550071728321);
  +  CertainlyComposite := UInt64(3215031751);
     Random := TRandom.Create(Round(Now * SecsPerDay * MSecsPerSec));
   
   end.
  
positive.code: 
    // Now check if A is a witness to N's compositeness
    Result := IsComposite(A, D, N, R);
  
  //  Estimate := BigInteger.ModPow(A, D, N);
  //  for I := 0 to R - 1 do
  //  begin
  //    NewEstimate := (Estimate * Estimate) mod N;
  //    if (NewEstimate = BigInteger.One) and (Estimate <> BigInteger.One) and (Estimate <> N - BigInteger.One) then
  //      Exit(True);
  //    Estimate := NewEstimate;
  //  end;
  //  Result := Estimate <> BigInteger.One;
  end;
  
  function IsComposite(const A, D, N: BigInteger; S: Integer): Boolean;
  
negative.code: var
    R: Integer;
    D: BigInteger;
  begin
    //  Write N - 1 as (2 ^ Power) * Factor, where Factor is odd.
    //  Repeatedly try to divide N - 1 by 2
  