Skip to content

Commit 55f739e

Browse files
committed
simplify nimber::product
1 parent 0534a95 commit 55f739e

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

cp-algo/number_theory/nimber.hpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,11 @@ namespace cp_algo::math::nimber {
109109

110110
// Public nimber product via isomorphism (no recursion, no Gauss at runtime)
111111
[[gnu::always_inline]]
112-
inline uint64_t nim_mul(uint64_t a, uint64_t b) {
113-
uint64_t pa = nim_to_poly(a);
114-
uint64_t pb = nim_to_poly(b);
115-
auto prod = clmul(pa, pb);
116-
uint64_t red = reduce_mod(prod);
117-
return poly_to_nim(red);
112+
inline uint64_t nim_product(uint64_t a, uint64_t b) {
113+
return poly_to_nim(reduce_mod(clmul(
114+
nim_to_poly(a),
115+
nim_to_poly(b)
116+
)));
118117
}
119118
}
120119

0 commit comments

Comments
 (0)