Rewrite a mathematical function. We consider the L(x; n) sum as defined in Chapter 3.1.4 and the corresponding function L2(x, epsilon) function from Chapter 3.1.6. The sum L(x; n) can be written as
where a is an expression involving i and x. This relation between ci and ci−1 means that we can start with term as c1, and then in each pass of the loop implementing the sumwe can compute the next term ci in the sum asRewrite the L2 function to make use of this alternative more efficient computation of the terms in the sum. Compare the new version with the original one to verify the implementation. Name of program file: L2_recursive.py.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here