Question: CODING IN SML LANGUAGE? Let us represent a polynom aaaa 1) by the list ao,a,a,.anl of its coefficents. (Notice that we list the coefficients in

 CODING IN SML LANGUAGE? Let us represent a polynom aaaa 1)

CODING IN SML LANGUAGE?

Let us represent a polynom aaaa 1) by the list ao,a,a,.anl of its coefficents. (Notice that we list the coefficients in the ascending order of their degree; the head element of the list is the coefficient of degree 0 etc.) (i) Code a function evalPoly real liat - real real that returns the value of a given polynom for a given value of r evalPoly [4.0,3.0,8.01 10.0 val it = 834.0 : real; (ii) Code a function addPoly : real list -real 1ist - real list that adds two polyno- mials. This works like long addition of decimal representations natural numbers, except that you do not have to worry about carries.) - addPoly [3.0,5.0,4.01 [40.0,30.0,80.0,90.0] val it [43.0,35.0,84.0,90.0 real list; (iii) Code a function multPoly real list ->real list -> real list that multiplies two polynomials This works like long multiplication of decimal representations nstural numbers except that you do not have to worry about carries. - multPoly [2.0,3.0,5.01 7.0,9.[14.0,39.0,62.0,45.0] val it [14.0,39.0.62.0,45.0 real list Let us represent a polynom aaaa 1) by the list ao,a,a,.anl of its coefficents. (Notice that we list the coefficients in the ascending order of their degree; the head element of the list is the coefficient of degree 0 etc.) (i) Code a function evalPoly real liat - real real that returns the value of a given polynom for a given value of r evalPoly [4.0,3.0,8.01 10.0 val it = 834.0 : real; (ii) Code a function addPoly : real list -real 1ist - real list that adds two polyno- mials. This works like long addition of decimal representations natural numbers, except that you do not have to worry about carries.) - addPoly [3.0,5.0,4.01 [40.0,30.0,80.0,90.0] val it [43.0,35.0,84.0,90.0 real list; (iii) Code a function multPoly real list ->real list -> real list that multiplies two polynomials This works like long multiplication of decimal representations nstural numbers except that you do not have to worry about carries. - multPoly [2.0,3.0,5.01 7.0,9.[14.0,39.0,62.0,45.0] val it [14.0,39.0.62.0,45.0 real list

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!