pub fn hypercube_eq<F: Field>(x: &[F], y: &[F]) -> F
Expand description
Evaluates the boolean Lagrange basis polynomial eq(x, y)
.
Formally, the boolean Lagrange basis polynomial is defined as:
eq(x_1, \dots, x_n, y_1, \dots, y_n) = \prod_{i=1}^n (x_i * y_i + (1 - x_i) * (1 - y_i)).
For boolean vectors x
and y
, the function returns 1
if x
equals y
and 0
otherwise.
ยงPanics
- Panics if
x
andy
have different lengths.