The Computer Language
24.04 Benchmarks Game

too simple C# aot #2 program

source code

/* The Computer Language Benchmarks Game
   https://salsa.debian.org/benchmarksgame-team/benchmarksgame/
*/

class TooSimple {
public static void Main(String[] args) {   
    long n = Int64.Parse(args[0]);
    double sum = 0.0;
    double flip = 1.0;
    for (long i = 1; i <= n; i++) {   
        sum += flip / (2*i - 1);     
        flip *= -1.0;                      
    }  
    Console.WriteLine("{0:f9}", sum*4.0);	
}
}
    

notes, command-line, and program output

NOTES:
64-bit Ubuntu quad core
.NET SDK 8.0.204
Host Version: 8.0.4
Commit: 2d7eea2529
<AllowUnsafeBlocks>true
<ServerGarbageCollection>true
<ConcurrentGarbageCollection>true
<PublishAot>true
<OptimizationPreference>Speed
<IlcInstructionSet>native



 Thu, 25 Apr 2024 22:06:32 GMT

MAKE:
cp toosimple.csharpaot-2.csharpaot Program.cs
cp Include/csharpaot/program.csproj .
mkdir obj
cp Include/csharpaot/project.assets.json ./obj
/usr/bin/dotnet publish
MSBuild version 17.9.8+b34f75857 for .NET
  Determining projects to restore...
  Restored /home/dunham/all-benchmarksgame/benchmarksgame_i53330/toosimple/tmp/program.csproj (in 852 ms).
  program -> /home/dunham/all-benchmarksgame/benchmarksgame_i53330/toosimple/tmp/bin/Release/net8.0/linux-x64/program.dll
  Generating native code
  program -> /home/dunham/all-benchmarksgame/benchmarksgame_i53330/toosimple/tmp/bin/Release/net8.0/linux-x64/publish/

20.46s to complete and log all make actions

COMMAND LINE:
 ./bin/Release/net8.0/linux-x64/native/program 10000000000

PROGRAM OUTPUT:
3.141592653