Skip to content
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

factor: Add 32b variant for modular arithmetic #1554

Merged
merged 29 commits into from
Jul 24, 2020
Merged

factor: Add 32b variant for modular arithmetic #1554

merged 29 commits into from
Jul 24, 2020

Commits on Jul 4, 2020

  1. Configuration menu
    Copy the full SHA
    43ee92c View commit details
    Browse the repository at this point in the history
  2. factor::numeric: Add a 32b Montgomery variant [WiP]

    ~32% faster
    nbraud committed Jul 4, 2020
    Configuration menu
    Copy the full SHA
    e68bb19 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a440807 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    4d28f48 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    774feb0 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    3f79be0 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    2824441 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    caa79a1 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    19a8231 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    53954ba View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    f95f977 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    b25c77c View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    d2b43f4 View commit details
    Browse the repository at this point in the history
  14. factor::miller_rabin::is_prime: Fix bug

    Montgomery<_> only works for odd n, so attempting to construct an instance
    for an even number results in a panic!
    
    The most obvious solution is to special-case even numbers.
    nbraud committed Jul 4, 2020
    Configuration menu
    Copy the full SHA
    3082903 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    0a1200b View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    600268c View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    1e4d824 View commit details
    Browse the repository at this point in the history
  18. factor::miller_rabin::tests: small_composites → small_semiprimes

    This is more descriptive, as semiprime are the products of 2 primes;
    all semiprimes are composite, but not all composite numbers are semiprime.
    nbraud committed Jul 4, 2020
    Configuration menu
    Copy the full SHA
    d2fa0fe View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    4f08e28 View commit details
    Browse the repository at this point in the history
  20. factor::miller_rabin: Hoist edge-cases (even, <2) out of test()

    test() takes a modulus that is known to not be even or <2 (otherwise the
    Montgomery value could not be constructed), so those checks can be hoisted
    into is_prime() and out of the critical path.
    nbraud committed Jul 4, 2020
    Configuration menu
    Copy the full SHA
    9b149a7 View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    3d6fdff View commit details
    Browse the repository at this point in the history
  22. factor::miller_rabin: Squash another bug! >:3

    Detected by the testsuite improvement just prior.
    nbraud committed Jul 4, 2020
    Configuration menu
    Copy the full SHA
    cbcc760 View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    7a1b86c View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    6256750 View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    6e228d3 View commit details
    Browse the repository at this point in the history

Commits on Jul 15, 2020

  1. Configuration menu
    Copy the full SHA
    c6276b7 View commit details
    Browse the repository at this point in the history

Commits on Jul 21, 2020

  1. factor::numeric::DoubleInt: Clarify methods and associated types

    - `DoubleInt::Double` renamed to `DoubleWidth`
    - `{as,from}_double()` renamed to `{as,from}_double_width()`.
    
    This should hopefully clarify that this is not a “double precision”
    floating-point type, but an integer type with a larger range (used
    for storing intermediate results, typ. from a multiplication)
    nbraud committed Jul 21, 2020
    Configuration menu
    Copy the full SHA
    96224f6 View commit details
    Browse the repository at this point in the history
  2. factor::numeric::Int: Remove from_u128 method

    It was unused, the debug assertions only need `to_u128`.
    nbraud committed Jul 21, 2020
    Configuration menu
    Copy the full SHA
    141d813 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    33a1c44 View commit details
    Browse the repository at this point in the history