# Lagrange basis in multiplicative subgroups

What’s a lagrange base?

if , otherwise.

## What’s the formula?

Arkworks has the formula to construct a lagrange base:

Evaluate all Lagrange polynomials at to get the lagrange coefficients. Define the following as

• : The coset we are in, with generator and offset
• : The size of the coset
• : The vanishing polynomial for .
• : A sequence of values, where , and

We then compute as

However, if in , both the numerator and denominator equal 0 when i corresponds to the value tau equals, and the coefficient is 0 everywhere else. We handle this case separately, and we can easily detect by checking if the vanishing poly is 0.

following this, for we have:

• and so on

## What’s the logic here?

https://en.wikipedia.org/wiki/Lagrange_polynomial#Barycentric_form