Velvet Star Monitor

Standout celebrity highlights with iconic style.

updates

Complexity of evaluating Lagrange polynomial

Writer Mia Lopez
$\begingroup$

Given a set of n + 1 data points $(x_i, f(x_i))$The langrange polynomial is given by:$$\sum_{i=0}^n f(x_i) \frac{(x-x_1)\cdot... (x-x_{i-1})(x-x_{i+1}) \cdot....\cdot(x-x_n)}{w_i}$$ with $w_i:= (x_i-x_1)\cdot ...\cdot(x_i-x_{i-1})(x_i-x_{i+1})\cdot....\cdot(x_i-x_n)$

To compute that you consider $$(x-x_1)\cdot...\cdot(x-x_n) \sum_{i=0}^n f(x_i) \frac{1}{w_i(x-x_i)}$$

Why does this computation leads to time complexity $O(n)$?

$\endgroup$ 14 Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy