This is the approximation to the logarithm function, but you can implement it directly using the approach mentioned in the exercise.