Any help would be VERY much appreciated. The function sqrt from the header file
ID: 3616451 • Letter: A
Question
Any help would be VERY much appreciated.The function sqrt from the header file cmath can be used to findthe square root of a nonnegative real number. Using Newton'smethod, you can also write an algorithm to find the square root ofa nonnegative real number within a given tolerance as follows:
Suppose x is a nonnegative real number, a is the approximate squareroot of x, and epsilon is the tolerance. Start with a = x; A. If |a* a - x| < (this is a less than with an underline) epsilon, thena is the square root of x within the tolerance; otherwise
B. Replace a with (a * a + x) / (2 * a) and repeat Step a.
Where |a * a - x| denotes the absolute value of a * a - x.
Write a recursive function to implement this algorithm to find thesquare root of a nonnegative real number. Also, write a program totest your function.