This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// コンパイルオプション:g++ -std=c++20 -Wall -O3 -march=native -mtune=native my_primes_2.cpp | |
#include <chrono> // for std::chrono | |
#include <cmath> // for std::log | |
#include <cstdint> // for std::int64_t | |
#include <format> // for std::format | |
#include <iostream> // for std::iostream | |
#include <vector> // for std::vector | |
namespace { | |
static auto constexpr MAX = 10000000000LL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// コンパイルオプション:g++ -std=c++20 -Wall -O3 -march=native -mtune=native my_primes.cpp | |
#include <chrono> // for std::chrono | |
#include <cmath> // for std::log | |
#include <cstdint> // for std::int32_t | |
#include <format> // for std::format | |
#include <iostream> // for std::iostream | |
#include <vector> // for std::vector | |
#include <boost/math/quadrature/gauss.hpp> // boost::math::quadrature::gauss | |
namespace { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 元のコード→ https://miyantarumi.hatenablog.com/entry/2022/04/08/080000 | |
#include <array> // for std::array | |
#include <cmath> // for std::asin, std::cos, std::exp, std::fabs, std::hypot, std::log, std::sqrt, std::sin | |
#include <cstdint> // for std::int32_t | |
#include <iomanip> // for std::setprecision | |
#include <ios> // for std::ios::fixed, std::ios::floatfield | |
#include <iostream> // for std::cout, std::endl | |
#include <utility> // for std::make_pair, std::pair | |
#include <vector> // for std::vector | |
#define HAVE_SSE2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 元のコード→ https://miyantarumi.hatenablog.com/entry/2022/04/08/080000 | |
#include <array> // for std::array | |
#include <cmath> // for std::asin, std::cos, std::exp, std::fabs, std::hypot, std::log, std::sqrt, std::sin | |
#include <cstdint> // for std::int32_t | |
#include <cstdlib> // for drand48, srand48 | |
#include <iomanip> // for std::setprecision | |
#include <ios> // for std::ios::fixed, std::ios::floatfield | |
#include <iostream> // for std::cout, std::endl | |
#include <utility> // for std::make_pair, std::pair | |
#include <vector> // for std::vector |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 元のコード→ https://miyantarumi.hatenablog.com/entry/2022/04/08/080000 | |
#include <array> // for std::array | |
#include <cmath> // for std::asin, std::cos, std::exp, std::fabs, std::hypot, std::log, std::sqrt, std::sin | |
#include <cstdint> // for std::int32_t | |
#include <iomanip> // for std::setprecision | |
#include <ios> // for std::ios::fixed, std::ios::floatfield | |
#include <iostream> // for std::cout, std::endl | |
#include <utility> // for std::make_pair, std::pair | |
#include <vector> // for std::vector | |
#define __AVX2_AVAILABLE__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 元のコード→ https://miyantarumi.hatenablog.com/entry/2022/04/08/080000 | |
#include <algorithm> // for std::fill | |
#include <cmath> // for std::asin, std::cos, std::exp, std::fabs, std::hypot, std::log, std::sqrt | |
#include <iomanip> // for std::setprecision | |
#include <ios> // for std::ios::fixed, std::ios::floatfield | |
#include <iostream> // for std::cout, std::endl | |
#include <random> // for std::mt19937, std::uniform_real_distribution | |
#include <utility> // for std::make_pair, std::pair | |
#include <vector> // for std::vector |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 元のコード→ https://miyantarumi.hatenablog.com/entry/2022/04/08/080000 | |
#include <array> // for std::array | |
#include <cmath> // for std::asin, std::cos, std::exp, std::fabs, std::hypot, std::log, std::sqrt, std::sin | |
#include <cstdint> // for std::int32_t | |
#include <cstdlib> // for std::rand, std::srand | |
#include <iomanip> // for std::setprecision | |
#include <ios> // for std::ios::fixed, std::ios::floatfield | |
#include <iostream> // for std::cout, std::endl | |
#include <utility> // for std::make_pair, std::pair | |
#include <vector> // for std::vector |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <array> // for std::array | |
#include <iomanip> // for std::setprecision | |
#include <ios> // for std::ios::fixed, std::ios::floatfield | |
#include <iostream> // for std::cout, std::endl | |
#define HAVE_SSE2 | |
#define HAVE_AVX2 | |
#include "dSFMT.h" | |
#include "dSFMT-2203-avx512.h" | |
namespace { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <array> // for std::array | |
#include <iomanip> // for std::setprecision | |
#include <ios> // for std::ios::fixed, std::ios::floatfield | |
#include <iostream> // for std::cout, std::endl | |
#define HAVE_SSE2 | |
#define HAVE_AVX2 | |
#include "dSFMT.h" | |
#include "dSFMT-2203-avx512.h" | |
namespace { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdint> // for std::uint32_t | |
#include <iomanip> // for std::setprecision | |
#include <ios> // for std::ios::fixed, std::ios::floatfield | |
#include <iostream> // for std::cout, std::endl | |
#define __AVX2_AVAILABLE__ | |
#include "SIMDInstructionSet.h" | |
#include "Xoshiro256Plus.h" | |
namespace { | |
inline double mcpi(); |
NewerOlder