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

Fixed incorrect formulas for coefficients. #304

Merged
merged 1 commit into from
May 9, 2024
Merged
Changes from all commits
Commits
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
Fixed incorrect formulas for coefficients.
This concerns only the comments for big integer multiplication where the formulas for the coefficients w0..w4 are explicitly listed. These were not completely correct.
secret-playfair-rust committed May 9, 2024
commit ba15044897e52e4fe23ea3eeeab1b9bf8881a2ce
4 changes: 2 additions & 2 deletions src/biguint/multiplication.rs
Original file line number Diff line number Diff line change
@@ -369,9 +369,9 @@ fn mac3(mut acc: &mut [BigDigit], mut b: &[BigDigit], mut c: &[BigDigit]) {
// in terms of its coefficients:
//
// w0 = w(0)
// w1 = w(0)/2 + w(1)/3 - w(-1) + w(2)/6 - 2*w(inf)
// w1 = w(0)/2 + w(1)/3 - w(-1) + w(-2)/6 - 2*w(inf)
// w2 = -w(0) + w(1)/2 + w(-1)/2 - w(inf)
// w3 = -w(0)/2 + w(1)/6 + w(-1)/2 - w(1)/6
// w3 = -w(0)/2 + w(1)/6 + w(-1)/2 - w(-2)/6 + 2*w(inf)
// w4 = w(inf)
//
// This particular sequence is given by Bodrato and is an interpolation