The Simpson’s 3/8th rule was developed by a mathematician named Thomas Simpson. Integration is the process of measuring the area under a function plotted on a graph.
The Simpson’s 3/8th rule is used in complex numerical integrations. This integration method uses parabolas to approximate each part of the curve. It is basically used to measure an area in a curve.
The Simpson’s 3/8th method is used for uniformly sampled function integration purpose. The Simpson’s 3/8th integration method is primarily used for numerical approximation of definite integrals.

Simpson’s Rule Formula

Simpson's 3/8 Rule Formula with Example, Output

C programming For simpson 3/8th rule :

#include<stdio.h>
int main()
{
    int n,i,j;
    printf("Enter the total Number of Input You want");
    scanf("%d",&n);
    float x[n],y[n],h,sum3,sumr;
    sum3=sumr=0;
    for(i=0;i<n;i++)
    {
        printf("Enter the value of X[%d] : ",i);
        scanf("%f",&x[i]);
    }
    for(i=0;i<n;i++)
    {
        printf("Enter the value of Y[%d] : ",i);
        scanf("%f",&y[i]);
    }
    h=((x[n-1]-x[0])/(n-1));
    for(i=1;i<n-1;i++)
    {
     if(i%3==0)
       {
       sum3=sum3+(2*y[i]);
       }
     else
       {
       sumr=sumr+(3*y[i]);
       }
    }
    printf("The Output is %f",3*h/8*((y[0]+y[n-1])+sum3+sumr));
    return 0;
}


Comments

Popular posts from this blog

Newton Backward Interpolation Formula