很简单吧:
double x = 1.5f;
while((Math.pow(x, 3) - x - 1) >= 0.0001)//不可能等于0的,所以要设置允许误差
x = Math.pow(x + 1, 1f / 3);
System.out.println(x);

解决方案 »

  1.   

    to ChDw(米),大哥,我也知道这样做可以,但是现在要求调用那个该死的迭代公式的方法。
      

  2.   

    不明白,我上面当然也调用这个公式了x = Math.pow(x + 1, 1f / 3);不就是等于 
    X(k+1) = (X(k) + 1) ^ 1/3 次方吗?这个就是迭代啊
      

  3.   

    import java.util.*;
    public class WORK{
    static double k;
    public static void invoke(double i){
    double j=i;
    i=Math.cbrt(i+1);
    if(j==i)  k=i;
    else{
    invoke(i);
    }
    }
    public static void main(String a[]){
    invoke(1.5);
    System.out.println(k);
    }
    }
      

  4.   

    这是老早以前一本书上讲的Finding the root of an equation is generally a time consuming task. Here is a method of root approximation using Newton's Method.When a root if found, the starting point automatically varies with the designated interval according to Newton's Method. A quadratic equation has been chosen as as example:input: Starting point
           Minute value
           Intervaloutput:Root valueExample:x^3 - 2*x^2 - x + 2 = 0  (Root = -1, 1, 2)Calculation is made with the starting point being 0, the minute value being 10^(-4) and the interval being 0.5. b = ((x-2)*x-1)x+2Contents (Formula)x(n+1) = x(n) - f(x(n))/f'(x(n))When the absolute value of the difference between x(n) and x(n+1) become less than 
    10^(-8), x(n) is displayed as a root. The differential f'(x) is defined follows:f'(x) = (f(x+h)-f(x))/h  (h: minute value)
      

  5.   

    ChDw(米)  正解 大学数值计算里面的非常简单一道题目
      

  6.   

    小弟解法:
    f(X) = X*X*X-X-1;
    用牛顿迭代法做:X(k+1)=X(k)-f(X(k))/f'(X(k))程序清单:
    public class NewDun
    {
    public final static double precise = 0.0000000001;

    public static void main(String args[])
    {
    double x0 = 1.5;
    double temp = 5.0;
    double x1 = 0.0;
    while(temp > precise)
    {
    x1 = x0 - (x0*x0*x0-x0-1)/(3*x0*x0-1);
    temp = Math.abs(x1-x0);
    x0 = x1; }

    System.out.println(x1);
    System.out.println(x1*x1*x1-x1-1);

    }
    }
      

  7.   

    /*
     * RootOfAnEquation.java
     *
     * Created on 2005年10月11日, 下午4:21
     *
     * To change this template, choose Tools | Template Manager
     * and open the template in the editor.
     */package javaapplication2;/**
     *
     * @author Trumplet
     */
    public class RootOfAnEquation {
        
        /** Creates a new instance of RootOfAnEquation */
        public RootOfAnEquation() {
        }
        
        static double Calculate(double x){
            double x1 = x*x*x - x - 1;  //在这里写方程的表达式
            return x1;
        }
        
        static double diff (double x, double h){
            double d = (Calculate(x+h)-Calculate(x))/h;
            return d;
        }
        
        public static void main(String[] args){
            
            double start = 1.5; // 初值
            double interval = 0.1;  // 增量
            double xn=start;
            
            while (Math.abs(Calculate(xn))>0.00000001){
                xn = xn - Calculate(xn)/(diff(xn,interval));
                System.out.println(xn);
            }
        }
    }运行结果:1.3590982286634463
    1.3285775499587462
    1.3250658031576152
    1.3247483823824004
    1.3247206111042094
    1.3247181886739026
    1.3247179774260416
    1.3247179590046105
    BUILD SUCCESSFUL (total time: 2 seconds)
      

  8.   

    迭代公式xk+1=立方根号下xk+1
    ---------------------------
    是这个哪个意思吗?
    x(k+1) = x(k) ^ (1/3) + 1或者
    x(k+1) = (x(k)+1) ^ (1/3)