MATH317LAB-math317数值分析代写
时间:2023-09-28
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.
4. Design and implement an \argument halving" function for computing the arctangent.
Showcase your code. Try to compute with your code.
Part 2
In this exercise, we will implement the shift-and-add (or CORDIC) type algorithm for
computing trigonometric functions as we have seen in class. Every time you implement a
code, showcase your code by examples.
1. Implement the algorithm for computing the tangent function. Do not forget to reduce
the argument from a general value to a value between 0 and =2. The pre-stored look-up
table values should be computed by your own code for computing the arctangent from
Part 1.
2. Taking the above code as a foundation, implement now functions for computing the sine
and cosine.
3. Implement a function for computing the arctangent.
4. Based on you arctangent function, write a function for computing the arcsine.
Date: Fall 2023.
1
2 DUE THURSDAY OCTOBER 5, 22:00 EDT
Homework policy
Please submit a link to your Jupyter notebook on an online repository (such as GitHub
or Google Colab) through the Assignments tab on MyCourses.
It should be such that anyone with the link is able to run the the code.
Include theory and commentaries in your Jupyter notebook, with Markdown cells.
Notebooks without sucient commentaries will not be accepted.
You can update your notebook up to the time limit, but please do not commit any
overdue updates.
You are welcome to consult each other provided (1) you list all people and sources
who aided you, or whom you aided and (2) you write-up the solutions (and the code!)
independently, in your own language. If you seek help from other people, you should be
seeking general advice, not specic solutions, and must disclose this help. This applies
especially to internet knowledge bases such as MathStackExchange and ChatGPT.
Similarly, if you consult books and papers outside your notes, you should be looking for
better understanding of or dierent points of view on the material, not solutions to the
problems.
essay、essay代写