Question: The function sqrt from the header file can be used to find the square root of a nonnegative real number. Using Newtons method, you can
The function sqrt from the header file
a. If |a2 - x| epsilon, then a is the square root of x within the tolerance; otherwise:
b. Replace a with (a2 + x) / (2a) and repeat Step a in which |a2 - x| denotes the absolute value of a2 - x. Write a recursive function to implement this algorithm to find the square root of a nonnegative real number. Also, write a program to test your function.
Turn in your source code file and one or more screen shots showing the results of your testing.
After completing this project you will show that you can
Identify the base case(s) and general case in a recursive algorithm
Utilize tail recursion in the construction of a recursive algorithm
Construct a recursive algorithm that does not use global variables
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
