**C program of Newton Backward Interpolation formula** : Newton has proposed several methods of estimating the values of any number at certain point by learning the behavior of previous values. Newton’s Backward interpolation formula is one of them. Newton’s backward interpolation is based on interpolating the newton’s polynomial which is sometimes also referred as **Newton’s divided differences interpolation polynomial** because the coefficients of the polynomial are calculated using divided differences.

(From Wikipedia) :Given a set of *k* + 1 data points

where no two *x*_{j} are the same, the interpolation polynomial in the **Newton form** is a linear combination of **Newton basis polynomials**

with the **Newton basis polynomials** defined as

for and . The coefficients are defined as

where is the notation for divided differences.

Thus the **Newton polynomial** can be written as

Now

If the nodes are reordered as , the **Newton Polynomial** becomes:

If are equally spaced with x= and

for ,then,

is called the **Newton Backward Divided Difference Formula**.

Now Let us see how to implement above logic using **C program**. Below **C program of Newton Backward Interpolation formula** which takes number of values of x as input from user and then takes values of x and corresponding values of y. Then it asks user at which point he wish to estimate the value and the displays the output value of N(x) at that point.

**C program of Newton Backward Interpolation Formula** :

#include<stdio.h> #include<conio.h> #include<math.h> #include<process.h> #include<conio.h> #include<stdlib.h> int main() { int n; int i,j,k; float mx[10],my[10]; float x,h,x0=0,fun=0,p; float y0,sum=0,diff[20][20]; float y1,y2,y3,y4; printf("----------------------------------------------------------------------\n"); printf("-------------------made by C code champ ------------------------------\n"); printf("----------------------------------------------------------------------\n"); printf("\n\n\t!! NEWTON'S BACKWARD INTERPOLATION FORMULA !! "); printf("\n\n Enter the values of x you want to enter -> "); scanf("%d",&n); printf("\n\n Enter the value in the form of x : "); for(i=0;i<n;i++) { printf("\n Enter the value of x[%d] : ",i+1); scanf("%f",&mx[i]); } printf("\n\n Enter the value in the form of y : "); for(i=0;i<n;i++) { printf("\n Enter the value of y[%d] : ",i+1); scanf("%f",&my[i]); } printf("\n\n Enter the value of x for which u want the value of y : "); scanf("%f",&x); // Calculation and processing section. h=mx[1]-mx[0]; for(i=0;i<n-1;i++) diff[i][1]=my[i+1]-my[i]; for(j=2;j<=4;j++) for(i=0;i<n-j;i++) diff[i][j]=diff[i+1][j-1]-diff[i][j-1]; i=0; while(!mx[i]>x) i++; x0=mx[i]; sum=0; y0=my[i]; fun=1; p=(x-x0)/h; sum=y0; for(k=1;k<=4;k++) { fun=(fun*(p-(k-1)))/k; sum=sum+fun*diff[i][k]; } // Output printf("\n When x = %6.4f , y = %6.8f\n\n",x,sum); getch(); system("pause"); }

We hope you all have enjoyed the C program of Newton Backward Interpolation formula i.e. backward divided difference. If you have any issues with above code, ask us in form of comments.

testing…

i read your article and loave it so much ,thank you so much.

hey buddy, this is a quite intriguing post

Touchdown! That’s a raelly cool way of putting it!

Thanks ! Supper Post !!

wow its great post..

Wow! Thank you! I permanently wanted to write on my site something like that. Can I include a part of your post to my blog?

Yes! you can include.

You’ve got it in one. Couldn’t have put it beettr.

If my probelm was a Death Star, this article is a photon torpedo.

Thank you a lot for providing individuals with a very splendid opportunity to read from this website. It really is so terrific and as well , stuffed with fun for me and my office colleagues to visit the blog particularly three times in 7 days to read through the new guides you have got. And lastly, I am just always fulfilled with your perfect solutions you serve. Some 2 facts in this post are completely the simplest we’ve ever had.

I have found a simpler code than this. Not sure which one is good.

C/C++ program for divide difference interpolation formula.

http://ashishrevar.com/2011/11/divide-difference-interpolation-formula/#comment-488