下载此文档

基于牛顿-拉夫森迭代算法的开方程序设计.doc


文档分类:IT计算机 | 页数:约4页 举报非法文档有奖
1/4
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/4 下载此文档
文档列表 文档介绍
基于牛顿-拉夫森迭代算法的开方程序设计.doc基于牛顿-拉夫森迭代算法的开方程序设计一:C语言主函数程序#include""#include""intcon_buf=0;inthtime=0;clock_tstart,stop,substraction;inta_in;inttemp1;inttemp2;intbeta=0;floatinput0=;floatinput1=0;shortintx;intx_temp;intflag1=0;intflag2=0;intflag=0;intq=0;//constfloata0=;shortinta0=21845;//q15//constfloata1=;shortconstinta1=11605;//q15//constinta2=;shortconstinta2=21528;//q14//constinta3=;shortconstinta3=25001;//q15//constinta4=;shortconstinta4=25703;//q14inta_out1=0;inta_out2=0;inttemp=0;floatoutput=0;main(){start=clock();input1=input0;while(input1>1){input1=input1/4;flag1+=1;}while(input1<){input1=input1*4;flag2+=1;}x=(int)(input1*32768);//q15//x_temp=(int)(input1*16384);//q14//a_in=a0*x+a1;temp=a0*x;//q30//a_in=a0*x+a1;////+a11a_in=(temp>>15)+a1;//q15//////+a1//beta=*x*x-*x+;////*x*xtemp=x*x;//q30temp1=temp>>15;//q15temp=temp1*a3;//30temp1=temp>>15;//q15////*x*x//*xtemp=a4*x;//q29temp2=temp>>14;//q15//*x//qiubetabeta=(temp1>>1)+a2-(temp2>>1);//q14//qiubeta//a_out1=beta*(x-a_in*a_in)+a_in;temp=a_in*a_in;//q30temp1=temp>>15;//q15temp2=x-temp1;temp=temp2*beta;//q30temp2=temp>>15;//q15a_out1=temp2+a_in;//q15//a_out2=beta*(x-a_out1*a_out1)+a_out1;temp=a_out1*

基于牛顿-拉夫森迭代算法的开方程序设计 来自淘豆网www.taodocs.com转载请标明出处.

非法内容举报中心
文档信息
  • 页数4
  • 收藏数0 收藏
  • 顶次数0
  • 上传人412702457
  • 文件大小21 KB
  • 时间2019-11-19