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

[Refactor] Unifying the API for computing Lagrange Polynomials #437

Open
chancharles92 opened this issue Nov 29, 2023 · 0 comments
Open

Comments

@chancharles92
Copy link
Contributor

Goal: have a unified and efficient implementation/API for computing the polynomial given n point-evaluation pairs.
E.g., the following two places are inlining different code for the same functionality.

// Lagrange interpolation:
// Given a list of points (x_1, y_1) ... (x_n, y_n)
// 1. Define l(x) = \prod (x - x_i)
// 2. Calculate the barycentric weight w_i = \prod_{j \neq i} 1 / (x_i -
// x_j)
// 3. Calculate l_i(x) = w_i * l(x) / (x - x_i)
// 4. Return f(x) = \sum_i y_i * l_i(x)

https://github.com/EspressoSystems/jellyfish/blob/kzg-multiproof-binyi/primitives/src/pcs/univariate_kzg/mod.rs#L621

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant