
#1
Jul811, 10:55 AM

P: 63

Hello, i have done the following code in c++ which gives me a result but :
1) I compute the product "prod*=(yx[i])/(x[k]x[i])" which has variable "y" inside ,but the result i take is just a number.(i want the result to be for example in this form "p(x)=1.02*x^3+2*x^2..." I can't understand how the program manipulates the variable y which does hasn't a value! 2) I don't know if i have it right.. The exercise is : Find Lagrange's polynomial approximation for y(x)=cos(π x), x ∈−1,1 using 5 points (x = 1, 0.5, 0, 0.5, and 1). My code :



Register to reply 
Related Discussions  
Approximation  Calculus & Beyond Homework  4  
Log Approximation  Calculus & Beyond Homework  7  
What is BCS approximation?  Quantum Physics  10  
second approximation  General Math  1  
Approximation math problem  General Math  1 