kimwalisch/primesieve — reverse-engineered prompt
Reverse engineered prompt
Build me a fast C++ prime number tool called primesieve. I want a terminal program that can count primes up to a number, print them when asked, work on a start and stop range, find the nth prime, and count or print twin primes and other small prime tuple patterns up to six numbers.
It should use all available CPU cores by default when ordering isn’t needed, let me choose the thread count, show elapsed time, and have a quiet mode. Please also include a small C and C++ library API so other programs can iterate through primes or get counts without shelling out.
Add a built in correctness test and a stress test mode for CPU or RAM with a timeout, because people use this to check system stability. Keep it portable with a simple CMake build, clear install instructions, examples, and docs. Focus on speed and low memory use for very large 64 bit ranges.
Want more depth? Deep Reverse