Question: Python. Solve for 1a and 1b Let's start with a problem about dealing with floating point issues. 1a) Consider evaluating the function f(x) = log(1
Python. Solve for 1a and 1b


Let's start with a problem about dealing with floating point issues. 1a) Consider evaluating the function f(x) = log(1 + x)/x near x = 0. In particular, compute the value at x = le-16. In [1]: import numpy as np x = le-16; y = np.log(1 + x)/x Out[1]: 0.0 The computed result is zero. What is the error associated with this value? The correct value is very close to 1.0 and the relative error in the value above is close to 100%. Find an alternative (approximate) expression that is accurate for [x] in
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
