-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Moved is_mersenne_prime
from factor_
to primetest
#25905
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The `is_mersenne_prime` is a function to test if a number is a Mersenne prime. It has been moved to `primetest` because it is more appropriate to have it in `primetest` rather than `factor_`. Also, the Lucas-Lehmer test, a Mersenne prime number test algorithm, has been implemented.
✅ Hi, I am the SymPy bot. I'm here to help you write a release notes entry. Please read the guide on how to write release notes. Your release notes are in good order. Here is what the release notes will look like: This will be added to https://github.com/sympy/sympy/wiki/Release-Notes-for-1.13. Click here to see the pull request description that was parsed.
Update The release notes on the wiki have been updated. |
Benchmark results from GitHub Actions Lower numbers are good, higher numbers are bad. A ratio less than 1 Significantly changed benchmark results (PR vs master) Significantly changed benchmark results (master vs previous release) | Change | Before [a00718ba] | After [f6933619] | Ratio | Benchmark (Parameter) |
|----------|----------------------|---------------------|---------|----------------------------------------------------------------------|
| - | 69.0±0.9ms | 43.9±0.3ms | 0.64 | integrate.TimeIntegrationRisch02.time_doit(10) |
| - | 67.1±0.3ms | 43.3±0.2ms | 0.64 | integrate.TimeIntegrationRisch02.time_doit_risch(10) |
| + | 17.8±0.4μs | 30.0±0.2μs | 1.68 | integrate.TimeIntegrationRisch03.time_doit(1) |
| - | 5.27±0.03ms | 2.82±0.03ms | 0.54 | logic.LogicSuite.time_load_file |
| - | 72.0±0.2ms | 28.2±0.06ms | 0.39 | polys.TimeGCD_GaussInt.time_op(1, 'dense') |
| - | 25.5±0.1ms | 16.7±0.09ms | 0.66 | polys.TimeGCD_GaussInt.time_op(1, 'expr') |
| - | 71.9±0.4ms | 28.5±0.3ms | 0.4 | polys.TimeGCD_GaussInt.time_op(1, 'sparse') |
| - | 253±2ms | 123±0.5ms | 0.48 | polys.TimeGCD_GaussInt.time_op(2, 'dense') |
| - | 256±0.8ms | 123±0.6ms | 0.48 | polys.TimeGCD_GaussInt.time_op(2, 'sparse') |
| - | 648±5ms | 364±2ms | 0.56 | polys.TimeGCD_GaussInt.time_op(3, 'dense') |
| - | 649±6ms | 366±1ms | 0.56 | polys.TimeGCD_GaussInt.time_op(3, 'sparse') |
| - | 488±2μs | 284±4μs | 0.58 | polys.TimeGCD_LinearDenseQuadraticGCD.time_op(1, 'dense') |
| - | 1.76±0ms | 1.03±0.01ms | 0.59 | polys.TimeGCD_LinearDenseQuadraticGCD.time_op(2, 'dense') |
| - | 5.71±0.06ms | 3.04±0.01ms | 0.53 | polys.TimeGCD_LinearDenseQuadraticGCD.time_op(3, 'dense') |
| - | 447±3μs | 227±2μs | 0.51 | polys.TimeGCD_QuadraticNonMonicGCD.time_op(1, 'dense') |
| - | 1.47±0.01ms | 661±3μs | 0.45 | polys.TimeGCD_QuadraticNonMonicGCD.time_op(2, 'dense') |
| - | 4.80±0.02ms | 1.61±0.02ms | 0.34 | polys.TimeGCD_QuadraticNonMonicGCD.time_op(3, 'dense') |
| - | 373±2μs | 201±0.9μs | 0.54 | polys.TimeGCD_SparseGCDHighDegree.time_op(1, 'dense') |
| - | 2.41±0.01ms | 1.23±0.01ms | 0.51 | polys.TimeGCD_SparseGCDHighDegree.time_op(3, 'dense') |
| - | 9.89±0.03ms | 4.24±0.01ms | 0.43 | polys.TimeGCD_SparseGCDHighDegree.time_op(5, 'dense') |
| - | 366±1μs | 166±2μs | 0.45 | polys.TimeGCD_SparseNonMonicQuadratic.time_op(1, 'dense') |
| - | 2.50±0.01ms | 879±4μs | 0.35 | polys.TimeGCD_SparseNonMonicQuadratic.time_op(3, 'dense') |
| - | 9.32±0.07ms | 2.64±0.01ms | 0.28 | polys.TimeGCD_SparseNonMonicQuadratic.time_op(5, 'dense') |
| - | 1.01±0.01ms | 422±3μs | 0.42 | polys.TimePREM_LinearDenseQuadraticGCD.time_op(3, 'dense') |
| - | 1.71±0.01ms | 510±2μs | 0.3 | polys.TimePREM_LinearDenseQuadraticGCD.time_op(3, 'sparse') |
| - | 5.65±0.03ms | 1.77±0.01ms | 0.31 | polys.TimePREM_LinearDenseQuadraticGCD.time_op(5, 'dense') |
| - | 8.36±0.07ms | 1.51±0ms | 0.18 | polys.TimePREM_LinearDenseQuadraticGCD.time_op(5, 'sparse') |
| - | 289±2μs | 64.3±0.5μs | 0.22 | polys.TimePREM_QuadraticNonMonicGCD.time_op(1, 'sparse') |
| - | 3.29±0.08ms | 388±2μs | 0.12 | polys.TimePREM_QuadraticNonMonicGCD.time_op(3, 'dense') |
| - | 3.85±0.06ms | 289±7μs | 0.07 | polys.TimePREM_QuadraticNonMonicGCD.time_op(3, 'sparse') |
| - | 6.81±0.09ms | 1.24±0.01ms | 0.18 | polys.TimePREM_QuadraticNonMonicGCD.time_op(5, 'dense') |
| - | 8.46±0.1ms | 855±9μs | 0.1 | polys.TimePREM_QuadraticNonMonicGCD.time_op(5, 'sparse') |
| - | 5.01±0.01ms | 3.00±0.01ms | 0.6 | polys.TimeSUBRESULTANTS_LinearDenseQuadraticGCD.time_op(2, 'sparse') |
| - | 11.8±0.09ms | 6.29±0.02ms | 0.53 | polys.TimeSUBRESULTANTS_LinearDenseQuadraticGCD.time_op(3, 'dense') |
| - | 22.5±0.3ms | 9.21±0.03ms | 0.41 | polys.TimeSUBRESULTANTS_LinearDenseQuadraticGCD.time_op(3, 'sparse') |
| - | 5.36±0.05ms | 883±6μs | 0.16 | polys.TimeSUBRESULTANTS_QuadraticNonMonicGCD.time_op(1, 'sparse') |
| - | 12.7±0.1ms | 7.06±0.02ms | 0.55 | polys.TimeSUBRESULTANTS_QuadraticNonMonicGCD.time_op(2, 'sparse') |
| - | 100.0±0.4ms | 25.0±0.1ms | 0.25 | polys.TimeSUBRESULTANTS_QuadraticNonMonicGCD.time_op(3, 'dense') |
| - | 164±0.6ms | 54.9±0.3ms | 0.33 | polys.TimeSUBRESULTANTS_QuadraticNonMonicGCD.time_op(3, 'sparse') |
| - | 172±0.5μs | 110±2μs | 0.64 | polys.TimeSUBRESULTANTS_SparseGCDHighDegree.time_op(1, 'dense') |
| - | 362±3μs | 215±1μs | 0.6 | polys.TimeSUBRESULTANTS_SparseGCDHighDegree.time_op(1, 'sparse') |
| - | 4.17±0.03ms | 823±6μs | 0.2 | polys.TimeSUBRESULTANTS_SparseGCDHighDegree.time_op(3, 'dense') |
| - | 5.13±0.02ms | 382±2μs | 0.07 | polys.TimeSUBRESULTANTS_SparseGCDHighDegree.time_op(3, 'sparse') |
| - | 19.1±0.2ms | 2.75±0.01ms | 0.14 | polys.TimeSUBRESULTANTS_SparseGCDHighDegree.time_op(5, 'dense') |
| - | 22.1±0.09ms | 628±4μs | 0.03 | polys.TimeSUBRESULTANTS_SparseGCDHighDegree.time_op(5, 'sparse') |
| - | 492±3μs | 137±1μs | 0.28 | polys.TimeSUBRESULTANTS_SparseNonMonicQuadratic.time_op(1, 'sparse') |
| - | 4.51±0.05ms | 611±1μs | 0.14 | polys.TimeSUBRESULTANTS_SparseNonMonicQuadratic.time_op(3, 'dense') |
| - | 5.19±0.03ms | 138±0.7μs | 0.03 | polys.TimeSUBRESULTANTS_SparseNonMonicQuadratic.time_op(3, 'sparse') |
| - | 12.6±0.05ms | 1.26±0.01ms | 0.1 | polys.TimeSUBRESULTANTS_SparseNonMonicQuadratic.time_op(5, 'dense') |
| - | 13.4±0.05ms | 140±1μs | 0.01 | polys.TimeSUBRESULTANTS_SparseNonMonicQuadratic.time_op(5, 'sparse') |
| - | 135±2μs | 74.9±0.3μs | 0.56 | solve.TimeMatrixOperations.time_rref(3, 0) |
| - | 250±0.4μs | 87.7±0.6μs | 0.35 | solve.TimeMatrixOperations.time_rref(4, 0) |
| - | 24.1±0.08ms | 10.2±0.1ms | 0.42 | solve.TimeSolveLinSys189x49.time_solve_lin_sys |
Full benchmark results can be found as artifacts in GitHub Actions |
Thanks for handling clean-up. |
thanks |
The
is_mersenne_prime
is a function to test if a number is a Mersenne prime. It has been moved toprimetest
because it is more appropriate to have it inprimetest
rather thanfactor_
. Also, the Lucas-Lehmer test, a Mersenne prime number test algorithm, has been implemented.References to other Issues or PRs
Brief description of what is fixed or changed
Other comments
Release Notes
is_mersenne_prime
fromfactor_
toprimetest