Newton Backward Interpolation Program in C

Newton Backward Interpolation Program in C

Newton Backward Interpolation Concepts and Program in C

This tutorial is helpful for computer science student to understand the concepts of interpolation, extrapolation in numeric techniques. This tutorial is also helpful for the students in implementing the program for backward interpolation in c programming language.
What is Interpolation ?
What is extrapolation ?
What is Newton Backward Interpolation Formula ?

newton interpolation program in c

Newton Backward Interpolation in C

Interpolation

Interpolation is a method of making the estimate of  the value of a function for any intermediate value of the independent variable.
Extrapolation

Extrapolation is a  process of computing the value of the function outside the given range.

What is Newton’s Forward and Backward Interpolation ?

Given the set of (n+1) values of x and y, it is required to find y n (x), a polynomial of the nth degree such that y and y n (x) agree at the tabulated points. The values of x be equidistant i.e. xi = x0 + ih, i=0, 1, 2…..n.
Since y n(x) is a polynomial of the nth Degree                                                              
y n(x) =a0 +a1(x-x0) +a2(x-x0)(x-x1)………….+an(x-x0)………….(x-x n-1)
Imposing now the condition that y and yn(x) should agree at the set of tabulated points and applying x=x0+ph we get Newton’s Forward difference interpolation formula which is given by.
y n(x) = y0 + pDy0 + p (p-1) / 2! D2y0+ p (p-1) (p-2) / 3! D3y0 + ……… + p (p-1) (p-2)…. (p-n+1) / n! Dn y0
It is useful for interpolation near the beginning of a set of tabular values.

Similarly if yn (x) chosen in the form

y n(x) = a0+a1 (x-x n) + a2 (x-x n) (x-x n-1) +……..an(x-x n) (x-x n-1)……(x-x1

then we have
y n (x) = y n + pÑy n + p(p+1) / 2 Ñ2 y n + ………+ p(p+1)…..(p+n-1) / n! Ñ n y n           where p= x-x n / h

This is newton’s backward difference interpolation formula and it uses tabular values to the left of y n. It is useful for interpolation near the end of the tabular values.

Newton Backward Interpolation Program in C

void main()
{
  float x[10],y[10][10],sum,p,u,temp;
  int i,n,j,k=0,f,m;
  float fact(int);
  clrscr();
  printf("\nhow many record you will be enter: ");
  scanf("%d",&n);
   for(i=0; i  {
   printf("\n\nenter the value of x%d: ",i);

   scanf("%f",&x[i]);

   printf("\n\nenter the value of f(x%d): ",i);

   scanf("%f",&y[k][i]);

  }

  printf("\n\nEnter X for finding f(x): ");

  scanf("%f",&p);

  for(i=1;i  {

    for(j=i;j    {

     y[i][j]=y[i-1][j]-y[i-1][j-1];

    }
  }
 printf("\n_____________________________________________________\n");
  printf("\n  x(i)\t   y(i)\t    y1(i)    y2(i)    y3(i)    y4(i)");
 printf("\n_____________________________________________________\n");
  for(i=0;i  {
    printf("\n %.3f",x[i]);
    for(j=0;j<=i;j++)
    {
     printf("   ");
     printf(" %.3f",y[j][i]);
    }
   printf("\n");
  }
  i=0;
  do
  {
   if(x[i]

    k=1;
   else
    i++;
  }while(k != 1);
  f=i+1;
  u=(p-x[f])/(x[f]-x[f-1]);
  printf("\n\n u = %.3f ",u);
  n=n-i+1;

  sum=0;
  for(i=0;i  {
   temp=1;

   for(j=0;j   {

    temp = temp * (u + j);

   }

    m=fact(i);

    sum = sum + temp*(y[i][f]/m);

  }

  printf("\n\n f(%.2f) = %f ",p,sum);

  getch();

}

float fact(int a)
{
  float fac = 1;
  if (a == 0)
   return (1);
  else
   fac = a * fact(a-1);
  return(fac);
}

Output

newton forward interpolation formula


COMMENTS

BLOGGER
Name

addressing modes types,1,advance-java,2,aktu entrance exam,1,aktu exam schedule,1,ASP,1,bare machine,1,base register and limit register,1,C Programming,12,C Plus Plus,1,C Programming,5,C Programming Questions,1,C programming study material for gate exam,7,Cache Memory,1,CBNST Program,1,Childcare,1,CJ,1,Cloud Computing,1,CN,3,Computer Architecture,2,Computer architecture based questions for gate exam,11,Computer Network,8,Computer Network Study Material,2,Computer network study material for gate,1,Computer Networks,8,Computer networks GATE Questions,2,Computer Science Study Material for Gate,14,computer science study material for gate exam,28,conditional statements in c,1,contiguous memory allocation,2,Core Java,3,cyber crime report,1,Cyber crime status,1,cybercrime and security,1,cybercrime examples,1,Data Structure,2,Data Structure Questions,1,Data Transmission Architecture,1,Data Transmission in wsn,1,database normalization,1,DBMS,6,dbms question paper,1,DE,1,Digital Electronics,1,DS,4,Dynamic memory allocation in c,1,Electroencephalogram,1,file management in operating system notes,1,Gate 2017,3,Gate 2017 Admit card,1,gate cse study material,1,gate practice set,7,gate study material for computer science,12,Gate study material for computer science 2017,1,General,3,HCL Aptitude Test,1,HR Interview Questions,1,HTML,4,Important Date of Gate 2017 Exam,1,Information Security Policy,1,internal and external fragmentation,1,JDBC,2,JS,1,lagrange's interpolation formula,1,lagrange's interpolation formula examples,1,memory fragmentation,1,memory management,1,memory management questions and answer in os,1,Motivational,4,NCER,1,Numerical Techniques Lab,1,OOT,1,Operating System,10,Operating System Gate Questions,1,Operating System Objective Questions,4,Operating System Questions Bank,1,Operating system questions for gate,1,Operating System Study material,2,operating system study material for gate exam,13,Operating system tutorial,2,page swapping,1,paged memory allocation,1,paged memory allocation in operating system,1,Pointer in C,4,Process based question for gate,1,Regression testing,1,relocation in memory management,1,relocation registe,1,relocation register,1,resident monitor,1,resident monitor in operating system,1,routing table,1,Software Engineering,10,Software Engineering baes study material for gate,1,Software Quality Assurance,3,software verification methods,1,Stack,1,Structure in C,1,Study Material for gate Computer Science,7,swapping in memory management,1,swapping in operating system,1,TCS Code Vita,1,TCS Interview Questions,1,Technical Interview,1,Technical Questions from DBMS,1,Thrashing in Operating System,1,Threads concept in operating system,1,Tips to Learn Coding,1,Types of operating system,1,UML,1,Virtualization,1,What is process control block ?,1,what is software testing?,1,Wireless Sensor Network,3,worst fit algorithm for memory allocation,1,XML,2,
ltr
item
Computer Science Junction: Newton Backward Interpolation Program in C
Newton Backward Interpolation Program in C
Newton Backward Interpolation Program in C
https://1.bp.blogspot.com/-eAmCVzXZTbY/XSbyGFqSOoI/AAAAAAAABXY/boON9NTBRyQcoIyIi1C6xyEyJmMaVf8xACLcBGAs/s400/newton%2Bbackward%2Binterpolaton.png
https://1.bp.blogspot.com/-eAmCVzXZTbY/XSbyGFqSOoI/AAAAAAAABXY/boON9NTBRyQcoIyIi1C6xyEyJmMaVf8xACLcBGAs/s72-c/newton%2Bbackward%2Binterpolaton.png
Computer Science Junction
https://www.computersciencejunction.in/2016/12/newton-backward-interpolation-program.html
https://www.computersciencejunction.in/
https://www.computersciencejunction.in/
https://www.computersciencejunction.in/2016/12/newton-backward-interpolation-program.html
true
425357657003182083
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share. STEP 2: Click the link you shared to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy