Question
C++ program Newton's method is taught in calculus classes as a way of finding roots of functions. One application is in finding cube roots. To
C++ program
Newton's method is taught in calculus classes as a way of finding roots of functions. One application is in finding cube roots. To do this, take an initial guess (say 1.00) and generate a new guess at the root using the formula: NewGuess = OldGuess - (pow(OldGuess, 3) - N) / (3 * pow (OldGuess, 2)) where N is the number whose root is to be determined. The NewGuess becomes the old guess in the next round. For example, if N = 29 and the initial guess is 1.00, the next guess is: NewGuess = 1.0 - (1.0 * 1.0 * 1.0 - 29) / (3 * 1.0 * 1.0) = 10.3333 which is then put into the equation to get the next guess: NewGuess = 10.3333- (10.3333* 10.3333* 10.3333- 29) / (3 * 10.3333* 10.3333) = 6.97941959 Write a function to find cube roots using this process. Repeat the process until two consecutive guesses are equal within 0.000001
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started