Skip to content

Commit

Permalink
Merge pull request #8 from byeongkeunahn/develop-7
Browse files Browse the repository at this point in the history
Improve NTT planning
  • Loading branch information
byeongkeunahn authored Sep 22, 2023
2 parents 4320297 + 2f4460b commit 3bb14f7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/biguint/ntt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,11 @@ impl NttPlan {
(g_new, tmp, cost) = (7, tmp/7, cost + len*115/100);
} else if len % 5 == 0 {
(g_new, tmp, cost) = (5, tmp/5, cost + len*89/100);
} else if m2 >= m3 + 3 {
} else if m3 >= m2 + 2 {
(g_new, tmp, cost) = (9, tmp/9, cost + len*180/100);
} else if m2 >= m3 + 3 && (m2 - m3) % 2 == 1 {
(g_new, tmp, cost) = (8, tmp/8, cost + len*130/100);
} else if m2 >= m3 + 2 {
} else if m2 >= m3 + 2 && m3 == 0 {
(g_new, tmp, cost) = (4, tmp/4, cost + len*87/100);
} else if m2 == 0 && m3 >= 1 {
(g_new, tmp, cost) = (3, tmp/3, cost + len*86/100);
Expand Down

0 comments on commit 3bb14f7

Please sign in to comment.