/*Computes and compares values of the sine using the library function and third degree Maclaurin polynomial in horner form. */ #include #include float Maclpoly(float);/* calls function Maclaurin polynomial in Horner form from Mpoly*/ int main(void) { float x,min,max,step; printf("Enter min, max and step\n"); scanf("%f\t%f\t%f",&min,&max,&step); printf("x\t\tsin(x)\t\tMsin(x)\t\tRelative error\n"); /*Prints the table header row*/ for (x=min;x<=max;x+=step) /*initializes x with min which increases by step until max is reached*/ printf("%f\t%f\t%f\t%f\n",x,sin(x),Maclpoly(x),(Maclpoly(x)-sin(x))/sin(x)); /*Prints x, sine value using library function, sine value using Maclaurin polynomial in horner form and the relative error*/ return 0; }