Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Spring 2019 ECE 263 Introduction to Computing Stephen Kim Lab 6 Objectives are .to design a program to integrate a polynomial symbolically and numerically. .

image text in transcribed
Spring 2019 ECE 263 Introduction to Computing Stephen Kim Lab 6 Objectives are .to design a program to integrate a polynomial symbolically and numerically. . to apply the struct construction to improve a program's readability 1. Array and Polynomial A polynomial in the variable x is a representation of a function as a formal sum f(x)-:0 a,x1, we call the values a-a,,-..,an-1 the coefficients of the polynomial. /(x) is said to have degree k if its highest non ero coeffi ent iak. Any integer strictly greater than the degree of a polynomial is a degree-bound of that polynomial. For example f(x)--1-2xx where f(x) has degree 3, has degree-bounds 4,5, 6.,.., or all values greater than the degree. f(x) has coefficients (-1,-2,0,1). A coefficient representation of a polynomial f(x)s -ax, of degree-bound n is a vector of efficient a- (ag,a.an-1). More examples (9,-10,7,6) (0,8,-2,-12,3) h(x)-8x- 2x-12x3 +3x The evaluation of the polynomial f(x) at point xo consists of computing the value of f(x The C programming language can represent a polynomial as the coefficient representation as an array. Consider the following evaluation function, say alpha) Rename the function], for a polynomial: double alpha (double f, int n, double xval); For example, you can use this function to evaluate a polynomial at a value double g[] - printf("g(XF) _ %f ", (9, -18, 7, 6); e,5, alpha(g, 4, 5)); makes the following output: g(8.seeeee) = 6.5eeeee You implement a function, say beta() [Rename the function),to print polynomial evaluation from an initial value to a final value at an interval of delta using the function alpha(). Use a C struct as below to specify this tuple of values as struct axis ( double xmin; double xmax; double delta; You will print the evaluations of g(x) and h(x) from-0.5 to +0.5 at the interval o.1 at the format as follows: e.588000 Ex) 0.40000e 0.50000e 15.808980 6.584008 h(x) -2.812580

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions