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

Update Mlucas.c, mi64.c for correct modular division (small scalars) #23

Merged
merged 29 commits into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
40f19df
Update Mlucas.c, mi64.c
xanthe-cat Apr 13, 2024
4c7210b
Update mi64.c
xanthe-cat Apr 13, 2024
0abbb0b
Update Mlucas.c
xanthe-cat Apr 14, 2024
2f22d54
Update config-fermat.sh
xanthe-cat Apr 14, 2024
4660d9e
Update mi64.c
xanthe-cat Apr 18, 2024
8b37f6a
Create Fermat-testing.md
xanthe-cat Apr 19, 2024
7df4185
Update docs/Fermat-testing.md
xanthe-cat Apr 20, 2024
92f5a44
Update Fermat-testing.md
xanthe-cat Apr 20, 2024
174e798
Update README.md
xanthe-cat Apr 20, 2024
d5faeff
Update Fermat-testing.md
xanthe-cat Apr 20, 2024
75f1de1
Update Mlucas.c
xanthe-cat Apr 21, 2024
27eddf4
Update Mlucas.c
xanthe-cat Apr 21, 2024
35edcb2
Update Mlucas.c
xanthe-cat Apr 23, 2024
5b4d7b6
Update config-fermat.sh
xanthe-cat Apr 23, 2024
8002627
Update Fermat-testing.md
xanthe-cat Apr 23, 2024
047bda2
Update config-fermat.sh
xanthe-cat Apr 23, 2024
b90d8b7
Update Mlucas.c
xanthe-cat Apr 23, 2024
9e2899c
Update Fermat-testing.md
xanthe-cat Apr 23, 2024
113b513
Update Fermat-testing.md
xanthe-cat Apr 23, 2024
493fabd
Update Fermat-testing.md
xanthe-cat Apr 23, 2024
4341a7e
Simplified config-fermat.sh script.
tdulcet Apr 23, 2024
585a79c
Update Mlucas.c
xanthe-cat Apr 23, 2024
4b435c8
Update README.md
xanthe-cat Apr 23, 2024
e336c6a
Update Mlucas.c
xanthe-cat Apr 24, 2024
c274cff
Update Mlucas.c
xanthe-cat Apr 26, 2024
579f4fe
Update Mlucas.c (SH residue fix)
xanthe-cat Apr 27, 2024
324e764
Update Mlucas.c (Suyama (A) bug for Mersenne PRP-CF tests)
xanthe-cat Apr 27, 2024
c3e672d
Update Mlucas.c (modifying ASSERT)
xanthe-cat Apr 27, 2024
e4c5f37
Update Mlucas.c (JSON timestamp field)
xanthe-cat Apr 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Mlucas.c
xanthe-cat marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ with the default #threads = 1 and affinity set to logical core 0, unless user ov
TEST_TYPE = TEST_TYPE_PRP;
} else { // PRP double-check:
// NB: Hit a gcc compiler bug (which left i = 0 for e.g. char_addr = ", 3 ,...") using -O0 here ... clang compiled correctly, as did gcc -O1:
i = (int)strtol(char_addr+1, &cptr, 10); ASSERT(HERE, i == 3,"PRP-test base must be 3!");
i = (int)strtol(char_addr+1, &cptr, 10); // ASSERT(HERE, i == 3,"PRP-test base must be 3!");
PRP_BASE = i;
ASSERT(HERE, (char_addr = strstr(cptr, ",")) != 0x0,"Expected ',' not found in assignment-specifying line!");
i = (int)strtol(char_addr+1, &cptr, 10); ASSERT(HERE, i == 1 || i == 5,"Only PRP-tests of type 1 (PRP-only) and type 5 (PRP and subsequent cofactor-PRP check) supported!");
Expand Down
3 changes: 2 additions & 1 deletion src/mi64.c
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More discussion on this fix (whether this is an appropriate way to resolve the float to int conversion issue) is over at issue #18.

Original file line number Diff line number Diff line change
Expand Up @@ -6901,7 +6901,8 @@ printf("\n");
itmp64 -= (uint64)fquo;
rem64 = rem64 + q*(uint64)fquo;
} else {
fquo = rem64*fqinv;
fquo = rem64*fqinv; // CXC: Give fquo a tiny push if we are in the 2nd pass, to ensure a 0.9999999999999 value actually gets to 1.0;
if(fquo >= 0.99999999999999 && fquo < 1.0) fquo += 0.00000000000001; // see https://github.com/primesearch/Mlucas/issues/18
itmp64 += (uint64)fquo;
rem64 = rem64 - q*(uint64)fquo;
}
Expand Down
Loading