История изменений
Исправление red75prim, (текущая версия) :
$ clang-8 --version
clang version 8.0.0-3~ubuntu18.04.1 (tags/RELEASE_800/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
$ clang++-8 test9.cpp -march=native -Ofast -std=gnu++2a -stdlib=libc++ -funroll-loops -o test9_cpp
$ ./test9_cpp 3000
13.4062
-287.25
$ clang++-8 test9.cpp -march=native -Ofast -std=gnu++2a -stdlib=libc++ -funroll-loops -o test9_cpp -mno-fma
$ ./test9_cpp 3000
13.3594
-287.25
$ ./test9_rust 3000
13.0280102s
-287.2500833333321
$ ./test9_rust 3000
12.9767008s
-287.2500833333321
$ ./test9_cpp 3000
13.5312
-287.25
Исходная версия red75prim, :
$ clang-8 --version
clang version 8.0.0-3~ubuntu18.04.1 (tags/RELEASE_800/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
$ clang++-8 test9.cpp -march=native -Ofast -std=gnu++2a -stdlib=libc++ -funroll-loops -o test9_cpp
$ ./test9_cpp 3000
13.4062
-287.25
$ clang++-8 test9.cpp -march=native -Ofast -std=gnu++2a -stdlib=libc++ -funroll-loops -o test9_cpp -mno-fma
red75:/mnt/d/git/test9$ ./test9_cpp 3000
13.3594
-287.25
$ ./test9_rust 3000
13.0280102s
-287.2500833333321
$ ./test9_rust 3000
12.9767008s
-287.2500833333321
$ ./test9_cpp 3000
13.5312
-287.25