baseConversionTuner.frink

View or download baseConversionTuner.frink in plain text format

// This program tunes the threshold for Schoenhage base conversion.

p=floor[13466917]

//p=20_996_011   // Largest known as of Nov. 2003
//p=25_964_951    // Largest known as of Feb. 2005.
// p = 30_402_457    // Largest known as of Dec. 2005.
// p = 32_582_657   // Largest as of September 2006
// p = 37_156_667   // Found in September 2008
//p = 43_112_609   // Also found (slightly earlier! in September 2008)
//p = 57_885_161

mp = 2^p-1

best = 1 year
tune = staticJava["frink.numeric.BaseConverter", "SCHOENHAGE_BASE_CONVERSION_THRESHOLD"].intValue[]
for a = 1 to 2
{
   start = now[]
   out1 = newToString[mp]   // Get string representation
   end = now[]

   if (end-start) < best
      best = (end-start)
}

println["$tune\t" + ((best) -> 1. seconds)]


View or download baseConversionTuner.frink in plain text format


This is a program written in the programming language Frink.
For more information, view the Frink Documentation or see More Sample Frink Programs.

Alan Eliasen was born 17835 days, 18 hours, 58 minutes ago.