HF RL Explorer

nth prime(n, approximate=True) returns wildly inaccurate results for large n

nth prime(n, approximate=True) returns wildly inaccurate results for large n: a task in repo2rlenv-swe-smith (Harbor dataset). When calling mi.nth prime(n, approximate=True) for values of n above 1,000,000, the returned value is a prime but deviates from the exact nth prime by more than 27–29%…

The task

When calling `mi.nth_prime(n, approximate=True)` for values of `n` above 1,000,000, the returned value is a prime but deviates from the exact nth prime by more than 27–29%, far exceeding the expected tolerance of less than 1% (i.e., relative error must be strictly less than `0.01`).

Part of FineEnvs/repo2rlenv-swe-smith.