Question: A method to compute a cubic root, 3 , > 0 , is + 1 = ( + 2 1 + 1 2 ) /

A method to compute a cubic root, 3,>0, is +1=(+21+12)/(2+1+12), n =1,2,..., with 0=1 and 1=.(That is, it is known that lim=3.). Write a function [cra,nitr]= myCubeRoot(a) which implements this calculation. The function should use a while-loop, terminate when the difference between +1 and becomes smaller than eps(10*a), and output +1 in cra and the value of n at which the while-loop was terminated in nitr. The function should use as little memory as possible. (For example, it should not store all the values of in a vector.) Use your function to compute the cube root of a =1860867 and a = prod(myvec(1:4)).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!