2. In this problem we make our own exponential function. Create a Matlab function whose prototype is: y = myExp (x) where the input x is a floating point number and the output y is the floating point approximation to y = e. In writing this function you are only allowed to use the operations of arithmetic (+ x +), absolute value (1-1) and any programming control statements you need. Your function should be accurate to 8 significant digits. (a) How have you computed e*? (b) How have you insured the desired accuracy? (e) How did you test your function? (d) In theory, what is the largest value of x your function will take without an overflow error? Explain.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter6: Modularity Using Functions
Section6.5: Variable Scope
Problem 4E
icon
Related questions
Question
2. In this problem we make our own exponential function.
Create a Matlab function whose prototype is: y = myExp (x) where the input x is a floating point number and
the output y is the floating point approximation to y = e. In writing this function you are only allowed to
use the operations of arithmetic (+ x +), absolute value (1) and any programming control statements
you need. Your function should be accurate to 8 significant digits.
(a) How have you computed e*?
(b) How have you insured the desired accuracy?
(c) How did you test your function?
(d) In theory, what is the largest value of x your function will take without an overflow error? Explain.
Transcribed Image Text:2. In this problem we make our own exponential function. Create a Matlab function whose prototype is: y = myExp (x) where the input x is a floating point number and the output y is the floating point approximation to y = e. In writing this function you are only allowed to use the operations of arithmetic (+ x +), absolute value (1) and any programming control statements you need. Your function should be accurate to 8 significant digits. (a) How have you computed e*? (b) How have you insured the desired accuracy? (c) How did you test your function? (d) In theory, what is the largest value of x your function will take without an overflow error? Explain.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Fundamentals of Boolean Algebra and Digital Logics
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr