⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 funct.c

📁 一些迭代求根法的C语言程序(简单迭代法、割线法、二分法等)些迭代求根法的C语言程序(简单迭代法、割线法、二分法等)
💻 C
字号:
/* This file should be used together with bisection.c or FixedPointIter.c 
 * or steffensen.c,etc. 
 * please refer to these files for detailed information.
 *
 * Created by Xiaoke Yang, Nov.1,2007
 * */

/* Modified by Xiaoke Yang, Nov.5,2007
 * Modification
 * Add another function df(x) and some notes
 * End Modification
 * */

/*DESCRIPTION: the function in equation f(x)=0, whose roots will be found*/
double f(double x){
/*	return exp(x)+10*x-2;*/
	double res;
	/*the roots are 1,2,3,4,5*/
	res=pow(x,5)-15*pow(x,4)+85*pow(x,3)-225*pow(x,2)+274*x-120;
	return res;
}

/*DESCRIPTION: the right hand of the iterated form of f(x)=0, i.e. x=g(x)*/
double g(double x){
/*	return exp(x)+11*x-2;*/
	return pow((3*x+18),1.0/3);
}

/*DESCRIPTION: the right hand of the iterated form of f(x)=0, i.e. x=g(x)*/
double phi2(double x){
	return log(10*x-2);
}

/*DESCRIPTION: the right hand of the iterated form of f(x)=0, i.e. x=g(x)*/
double phi3(double x){
	return (2-exp(x))/10;
}

/*DESCRIPTION: the derivative of function f(x)*/
double df(double x){
	double res;
	res=x*x;
	return res;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -