Skip to content

Commit 7b8ef54

Browse files
committed
add failing test for polynomial evaluation
1 parent 34c6011 commit 7b8ef54

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

twenty-first/src/shared_math/polynomial.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2539,6 +2539,19 @@ mod test_polynomials {
25392539
assert_eq!(poly, poly_interpolated);
25402540
}
25412541

2542+
#[test]
2543+
fn fast_coset_evaluate_on_small_domain() {
2544+
// x^5 + x^3
2545+
let poly_coefficients = [0, 0, 0, 1, 0, 1].map(BFieldElement::new).to_vec();
2546+
let poly = Polynomial::<BFieldElement>::new(poly_coefficients);
2547+
2548+
let domain_length = 4;
2549+
let offset = BFieldElement::generator();
2550+
let primitive_root = BFieldElement::primitive_root_of_unity(domain_length as u64).unwrap();
2551+
2552+
poly.fast_coset_evaluate(offset, primitive_root, domain_length);
2553+
}
2554+
25422555
#[test]
25432556
fn fast_and_slow_evaluation_are_equivalent() {
25442557
let poly_coefficients = [0, 0, 0, 1, 0, 1].map(BFieldElement::new).to_vec();

0 commit comments

Comments
 (0)