Question: For this assignment, write some functions that duplicate those in the standard math library Don't use any standard math library functions in your functions. Use

 For this assignment, write some functions that duplicate those in the

For this assignment, write some functions that duplicate those in the standard math library Don't use any standard math library functions in your functions. Use standard math functions only in main for testing. 3. Write the function double mypow ( double x, double p; that returns x raised to the p power. Do this by using the above functions: x ) . Compute: mylog( x ) = log( . Compute: p*mylog( x ) = log( Xp ) . Compute: myexpl p*mylog ( x ) ) = myexp ( log( Xp )) = Xp In conventional notation: logXP2p logx, elog z=z, soep logx=Xp For example, mylog ( 3 ) = 1.0986 2*mylog( 3 ) = 2.1972 myexp 2.1972 8.99977 932 Notice that in computing 3*3 by the above method takes the execution of approximately 900 statements in C, each of which will be implemented as several machine language statements. Of course, your functions cannot use any of the standard math functions. In particular, don't use pow () anywhere except in testing. Assume that x is fairly small and positive, say about 0 to 25 and that p is also fairly small say -10 to +10. Don't explicitly test for values outside of these ranges; just expect increasingly inaccurate results. For this assignment, write some functions that duplicate those in the standard math library Don't use any standard math library functions in your functions. Use standard math functions only in main for testing. 3. Write the function double mypow ( double x, double p; that returns x raised to the p power. Do this by using the above functions: x ) . Compute: mylog( x ) = log( . Compute: p*mylog( x ) = log( Xp ) . Compute: myexpl p*mylog ( x ) ) = myexp ( log( Xp )) = Xp In conventional notation: logXP2p logx, elog z=z, soep logx=Xp For example, mylog ( 3 ) = 1.0986 2*mylog( 3 ) = 2.1972 myexp 2.1972 8.99977 932 Notice that in computing 3*3 by the above method takes the execution of approximately 900 statements in C, each of which will be implemented as several machine language statements. Of course, your functions cannot use any of the standard math functions. In particular, don't use pow () anywhere except in testing. Assume that x is fairly small and positive, say about 0 to 25 and that p is also fairly small say -10 to +10. Don't explicitly test for values outside of these ranges; just expect increasingly inaccurate results

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!