C语言一道难题啊(看不懂,不会做)

来源:百度知道 编辑:UC知道 时间:2024/06/17 05:44:48
题目是这样的:
let a be a positive real number,and let the sequence of real numbers xi be given by
X0=1,Xi+1=1/2(Xi+a/xi) for i=0,1,2........

it can be shown mathematically that
Xi--->根号a(打不出英文) as i--->(无穷大)

this algorithm is derived from the newton-raphson method in numerical analysis.
write a program that reads in the value of a .as you will see,the algorithm is very efficient.(none-theless,it is not the algorithm used by the sqrt()function in the standard library.)
declare x0 and x1 to be of type double,and initialize x1 to 1.inside a loop do the following:

x0=1; /*save the current value of x1*/
x1=0.5*(x0+a/x0); /*compute a new value of x1*/

the body of the loop should be executed as long as x0 is not equal to x1.each time through the loop,print out the iteration count and values of x1(converging to the sequence root of a)and a-x1*x1(a check on accuracy)

这段是程序吗?是英文说明吧~!~!~!

我晕..你找本数值分析的C语言描述版吧...

这不是c语言,是一个算法!这个算法来自一个叫牛顿什么的方法,介绍算法的实施过程的~