Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
MATH 317 LAB ASSIGNMENT 1
DUE THURSDAY OCTOBER 5, 22:00 EDT
Part 1
In this exercise, we will do an experimental study of some of the classical \argument
halving" methods. To help you get started, two functions called naivelog and mylog are
provided in an accompanying separate text le. Do not hesitate to be creative.
1. Explain the workings of the functions naivelog and mylog in detail. Do not ignore the
case when the argument x is between 0 and 1. What is the role of the parameter n?
2. Compute the logarithms of the numbers 1; 2; : : : ; 14 by using the functions naivelog and
mylog, and compare the errors with Python's built-in function math.log taken as the
\gold standard." Change the parameter n to be 15; 20; 25; 30; 35 and see what happens
to the errors. Explain, as quantitatively as possible, why the functions naivelog and
mylog behave dierently.
3. Implement functions for computing the exponential, sine, and cosine, following the same
\argument halving" philosophy. Showcase your code with examples. Here note that for
instance, for trigonometric functions the choice of the argument x = 1; 2; : : : ; 14 is not
so good. Instead, one might want to choose x = 0; 0:1; 0:2; : : : ; 1:6, that is, x varies from
0 to just over =2.