SOLUTION: I would like to ask about how to solve cube root by using method of iteration with +,-,/,* only with Javascript? Or just simply tell me the method.

Algebra ->  Graphs -> SOLUTION: I would like to ask about how to solve cube root by using method of iteration with +,-,/,* only with Javascript? Or just simply tell me the method.      Log On


   



Question 766393: I would like to ask about how to solve cube root by using method of iteration with +,-,/,* only with
Answer by MathLover1(20850) About Me  (Show Source):
You can put this solution on YOUR website!
go to
http://www.math.utah.edu/~treiberg/M1225L5.txt
there are good explanation of this method

I know something about C++, not Java,but I was curious to find something that might help you. Here is one code I found, try it:
package mypkg;
//// Mikey
public class Main
{
public static void main(String[] args)
{
cubeIT(12.0);
}
public static void cubeIT(double a)
{
double x = a/2;
double XX;
for (int i = 0; i <5; i++)
{
x = x * ((x*x*x) + a + a) / (x*x*x + x*x*x + a);
System.out.print(x);
}
System.out.printf("%8.4f\n",x);
}