The natural logarithm can be computed using the series expansion
(1-1) 0<22.To extend the range of possible values, we may writewhere k is an integer, and thenCopyright By Assignmentchef assignmentchef
In(y) = klm(2) + In(x).
Write a Maple procedure which takes as its argument an arbitrary positive number y, and
computes In(y) as follows.
If 0.5 < y < 1.5 then put k = 0. Otherwise, use do loops to find the unique integer ksuch that 2k-1Compute r using (+) and then In(2) using (*). Finally, compute In(y) using ().Test your procedure for at least three input values.The idea here is that all logarithms can be computed efficiently provided In 2 is known; henceyou must not use a logarithm to find k. However you can use the built in logarithm functionto find In(2). CS: assignmentchef QQ: 1823890830 Email: [email protected]
Reviews
There are no reviews yet.