Newton Gregory Backward Interpolation

Newton Gregory Backward Interpolation :

ALGORITHM :

  1. Start of the program.
  2. Input number of terms n
  3. Input the array ax
  4. Input the array ay
  5. h=ax[1]-ax[0]
  6. for i=0; i<n–1; i++
  7. diff[i][1]=ay[i+1]–ay[i]
  8. End Loop i
  9. for j = 2; j < = 4; j + +
  10. for i=0; i<n–j; i++
  11. diff[i][j]=diff[i+1][j–1]–diff [i][j–1]
  12. End Loop i
  13. End Loop j
  14. i=0
  15. Repeat Step 16 until (!ax[i]<x)
  16. i=i+1
  17. x0=mx[i]
  18. sum=0
  19. y0=my[i]
  20. fun=1
  21. p=(x–x0)/h
  22. sum=y0
  23. for k=1; k<=4; k++
  24. fun=(fun*(p–(k–1)))/k
  25. sum=sum+fun*diff[i][k]
  26. End loop k
  27. Print Output x,sum
  28. End of Program

C SOURCE CODE :

OUTPUT :

Nweton's Gregory Backward Interpolation

Leave a Reply

Your email address will not be published. Required fields are marked *