亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? bigfunc.c

?? 隨機數(shù)算法
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*****************************************************************										        **		Add on some more complex functions.  These are mostly used to find	**	different constants to be used in various expansions of trig and exp		**	functions.  Need to combine with polynomials of floats to create all terms	**	of a full expansion using Chebyshev polynomials and reducing to standard	**	polynomials.									**					Author = Mike Rosing				**					 date   = May 1, 2000				**											*****************************************************************/#include "bigfloat.h"#include "multipoly.h"void split( FLOAT *x, FLOAT *intprt, FLOAT *frac);extern RAMDATA ram_block[];MULTIPOLY	twoxcoef;		/*  2^x expansion series coefficients  */MULTIPOLY	coscoef;		/*  cos(x)  expansion series coefficients  */MULTIPOLY       log2coef;               /*  log_2(x) expansion series coefficients */FLOAT		P2;			/*  PI/2  */FLOAT		ln2;			/*  ln(2)	*/FLOAT           bconst;                 /*  needed in log_2(x)  *//*  set a float to a constant 1  */void one( FLOAT *x){	null( x);	x->expnt = 1;	x->mntsa.e[MS_MNTSA] = 0x40000000;}/*  compute pi to 250 bits  or so.  	Uses formula arcsin(1/2) = pi/6 = pi/2 - 1 - sum(		1*3*5*...*(2k-1))/(2^3k (2k+1) k!)*/void calcpi( FLOAT *pi){	FLOAT tn, constant;	int i;		null( pi);	int_to_float( 1, &tn);	tn.expnt = -2;	int_to_float( 3, &constant);	divide( &tn, &constant, &tn);	add( pi, &tn, pi);	for( i=2; i<123; i++)	{		int_to_float( 2*i-1, &constant);		multiply(&constant, &constant, &constant);		multiply( &constant, &tn, &tn);		int_to_float( 2*i+1, &constant);		divide( &tn, &constant, &tn);		int_to_float( i, &constant);		divide( &tn, &constant, &tn);		tn.expnt -= 3;		add( &tn, pi, pi);	}	int_to_float( 1, &constant);	add( &constant, pi, pi);	int_to_float( 3, &constant);	multiply( &constant, pi, pi);}/*  Output of above routine is:tn.expnt = -256pi = E +3.14159265358979323846264338327950288419716939937\	510582097494459230781640628585258pi.expnt = 2pi.mntsa.e[] = {	 0x1d89cd8c,  0x105df53,  0x4533e63a,  0x94812704,  	 0xc06e0e68,  0x62633145,  0x10b4611a,  0x6487ed51                      }*//*  compute ln(2) to 256 bits.	ln(2) = 2 sum( 1/( (2k+1) * 3^(2k+1) ))	which converges in about 70+ terms.*/void calcln2( FLOAT *ln2){	int	k, epsilon, startxp;	FLOAT	tk, constant, nine;		null( ln2);	int_to_float( 3, &constant);	reciprical( &constant, &tk);	// gives me t0	startxp = tk.expnt;	multiply( &tk, &tk, &nine);	// additional 3^2k term	epsilon = 1;	k = 0;		while( epsilon > -256)	{		add( &tk, ln2, ln2);		int_to_float( 2*k+1, &constant);		multiply( &constant, &tk, &tk);		int_to_float( 2*k+3, &constant);		divide( &tk, &constant, &tk);		multiply( &nine, &tk, &tk);		epsilon = tk.expnt - startxp;		k++;	}	ln2->expnt++;		// final multiply by 2}/*  compute y = x^k	where k is a signed integer in range +/- 2^31 and x, y are FLOAT.	Copied from complex version.	Returns 1 if ok, 0 if x = 0 and k<0*/int intpwr( FLOAT *x, int k, FLOAT *y){	int signflag, n;	FLOAT z, t;	/*  initialize Knuth's algorithm A pg 442 V2  */	copy( x, &z);	if( k<0)	{		signflag = -1;		n = -k;	}	else	{		signflag = 0;		n = k;	}	int_to_float( 1, &t);	while( n)	{		if( n & 1) multiply( &t, &z, &t);		multiply( &z, &z, &z);		n >>= 1;	}	if( signflag) return reciprical( &t, y);	copy( &t, y);	return 1;}/*  This routine computes bessel functions for real arguments	for nth order to accuracy of 256 bits.  Accuracy is easy to 	change, assuming storage chages.  Purpose is coefficients	for exp and trig functions approximated by chebyshev	polynomials.	Enter with type = +1 for In(x) and type = -1 for Jn(x),		FLOAT pointing to x, integer n	Returns with Float y = Jn(x) or In(x).	uses |n|*/void bessel( int type, int n, FLOAT *x, FLOAT *y){	FLOAT	z2, z4, constant, t1, sum;	int		startxp, epsilon, j, k;		if( n<0) n = -n;	copy( x, &z2);	z2.expnt--;		// divide input by 2	multiply( &z2, &z2, &z4);		// z^2/4	if( type < 0) negate( &z4);	int_to_float( 1, &t1);	j = n;			// compute 1/n!	while( j>1)	{		int_to_float( j, &constant);		multiply( &constant, &t1, &t1);		j--;	}	reciprical( &t1, &sum);	startxp = sum.expnt;	copy( &sum, &t1);	/*  when next term exponent is 256 less than starting	exponent, we have more bits of accuracy.	j and k increment by 1 each time to create factorial	terms 1/k! and 1/(n+j)!*/	j = n;	k = 0;	epsilon = 1;	while( epsilon > -250)	{		j++;		k++;		int_to_float( j, &constant);		divide( &t1, &constant, &t1);		multiply( &z4, &t1, &t1);		int_to_float( k, &constant);		divide( &t1, &constant, &t1);		add( &t1, &sum, &sum);		epsilon = t1.expnt - startxp;	}	intpwr( &z2, n, &t1);	multiply( &t1, &sum, y);}/* create table of chebyshev polynomials.	Enter with maximum degree desired and array large	enough to hold the MULTIPOLY data pointers.	Returns array of pointers filled and maximum	degree successfully created.		T(n,x) = 2xT(n-1, x) - T(n-2, x)*/int gen_chebyshev( MULTIPOLY *chebary, int degree){	int 		numgen;	FLOAT	*fptr;	MULTIPOLY twox, temp;		if( degree < 0) return 0;	twox.degree = 1;	if( !get_space( &twox)) return 0;	fptr = Address(twox);	null( fptr);	fptr++;	int_to_float( 2, fptr);	numgen = 0;	chebary[0].degree = 0;	if( !get_space( chebary))  goto chebdie;	fptr = Address( chebary[0]);	int_to_float( 1, fptr);	numgen++;	if (degree < 1) return 1;	chebary[1].degree = 1;	if( !get_space( &chebary[1])) goto chebdie;	fptr = Address( chebary[1]);	null( fptr);	fptr++;	int_to_float( 1, fptr);	numgen++;	while( numgen <= degree)	{		chebary[numgen].degree = numgen;		if( !get_space( &chebary[numgen])) break;		multi_mul( twox, chebary[numgen - 1], &temp);		multi_sub( temp, chebary[numgen - 2], &chebary[numgen]);		free_space( &temp);		numgen++;	}chebdie:	free_space( &twox);	return numgen;}/*  compute coefficients of 2^x using Chebyshev polynomials.		2^x  =  I(0, ln(2)) + sum{ 2*I(n, ln(2))*T(n, x)} n = 1... oo		Enter with pointer to table of cheybshev polynomials, 	maximum degree of approximation and pointer to where	you want result.	Returns with power series in x of above, and max degree	actually computed.*/int calc_2x_coef( MULTIPOLY *cheb,  int maxdegree, 				MULTIPOLY *twoxcoef){	INDEX		i, j;	FLOAT		ibesl, *iptr;	MULTIPOLY	tnterm, sum;		char		test[32];		calcln2( &ln2);		sum.degree = 0;	if( !get_space( &sum))	{		printf(" no space left, calc_2x_coef \n");		return 0;	}	iptr = Address(sum);	bessel (+1, 0, &ln2, iptr);	for( i=1; i<=maxdegree; i++)	{		bessel( +1, i, &ln2, &ibesl);		ibesl.expnt++;		multi_dup( cheb[i], &tnterm);		for( j = (i&1); j<=i; j += 2)		{			iptr = Address( tnterm) + j;			multiply( &ibesl, iptr, iptr);		}		if( !multi_add( tnterm, sum, &sum)) break;		free_space( &tnterm);	}	if( i< maxdegree)  free_space( &tnterm);	else i = maxdegree;	multi_dup( sum, twoxcoef);	free_space( &sum);	return (i);}/*  compute coefficients of cos(x*PI/2) using Chebyshev polynomials.		cos(x*P2)  =   J(0, P2) + 2*sum{(-1)^n*J(2n, P2)*T(2n+1, x)} n = 1... oo		Enter with pointer to table of cheybshev polynomials, 	maximum degree of approximation and pointer to where	you want result.	Returns with power series in x^2 of above, and max degree	actually computed.  cos( x*PI/2) = sum{ a_j * (x^2)^j}.		NOTE:  All formulas in all the books I found are WRONG.  None have	the (-1)^n factor, but they act like it's there when constructing	the polynomial.*/int calc_cos_coef( MULTIPOLY *cheb,  int maxdegree, 				MULTIPOLY *coscoef){	INDEX		i, j, k;	FLOAT		jbesl, *jptr, *kptr;	MULTIPOLY	tnterm, sum;		char		test[32];	calcpi( &P2);	P2.expnt--;	sum.degree = 0;	if( !get_space( &sum))	{		printf(" no space left, calc_cos_coef \n");		return 0;	}	jptr = Address(sum);	bessel(-1, 0, &P2, jptr);	for( i=1; i<=maxdegree/2; i++)	{		k = 2*i;		bessel( -1, k, &P2, &jbesl);		jbesl.expnt++;		if( i&1) negate( &jbesl);		multi_dup( cheb[k], &tnterm);		jptr = Address( tnterm);		for( j = 0; j<=k; j += 2)		{			multiply( &jbesl, jptr, jptr);			jptr += 2;		}		if( !multi_add( tnterm, sum, &sum)) break;		free_space( &tnterm);	}	if( i< maxdegree/2)  	{		free_space( &tnterm);		i = 2*i;	}	else i = maxdegree;/*  convert to polynomial in x^2  */	j = sum.degree/2;	coscoef->degree = j;	if( !get_space(coscoef))	{		printf(" no space for cosine.\n");		return 0;	}	for( k=0; k<=j; k++)	{		kptr = AddressOf( coscoef) + k;		jptr = Address( sum) + 2*k;		copy( jptr, kptr);	}	free_space( &sum);	return (i);}/*  compute coefficients for logarithm base 2 expansion.    Assumes ln(2) already computed!    Enter with pointer to table of chebyshev polynomials,    maximum degree (should be odd) and    pointer to where you want result.    creates bconst for use in main routine.    Value returned is maximum degree actually computed.*/int calc_ln_coef( MULTIPOLY *cheb, int maxdegree, MULTIPOLY *log2coef){  INDEX i, j;  FLOAT *iptr, r, temp, root2, rsqrd;  MULTIPOLY sum, term;/*  log_2(t) = 0.5 + 4/ln(2) * sum( r^(2k+1)/(2k+1) * T_(2k+1)(x))      r = (2^.25 - 1)/(2^.25 + 1)      x = (t - 2^.5)/( t + 2^.5) * b

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本欧美大码aⅴ在线播放| 欧美一卡二卡在线观看| 中文字幕精品在线不卡| 风间由美性色一区二区三区| 中文字幕不卡在线播放| 91色在线porny| 亚洲国产精品视频| 日韩免费性生活视频播放| 国产乱对白刺激视频不卡| 中文字幕精品一区二区三区精品| 成人免费视频网站在线观看| 亚洲裸体xxx| 欧美日韩国产高清一区二区三区 | 在线播放/欧美激情| 天天综合日日夜夜精品| 欧美大尺度电影在线| 国产精品一线二线三线| 亚洲免费av网站| 日韩欧美亚洲一区二区| 国产专区欧美精品| 日韩理论片网站| 91精品国产91久久综合桃花| 国产精选一区二区三区| 亚洲一区二区中文在线| 日韩欧美色综合| 91视频免费看| 精品在线一区二区| 亚洲黄色尤物视频| 久久久九九九九| 在线电影一区二区三区| 精品无人区卡一卡二卡三乱码免费卡| 亚洲国产精品av| 欧美精品乱码久久久久久按摩| 黄一区二区三区| 亚洲成人精品一区| 欧美国产精品中文字幕| 欧美疯狂做受xxxx富婆| 99久久99久久久精品齐齐| 人人狠狠综合久久亚洲| 综合自拍亚洲综合图不卡区| 日韩欧美一区在线观看| 色综合久久久久久久久久久| 国产一区二区不卡老阿姨| 亚洲午夜激情网站| 国产视频一区在线播放| 欧美一区二区三区视频免费| 91丝袜美腿高跟国产极品老师| 精品一区二区在线看| 亚洲成人先锋电影| 国产精品久久久99| 久久精品水蜜桃av综合天堂| 欧美日韩国产高清一区二区| 一本一本久久a久久精品综合麻豆| 韩国欧美一区二区| 日本vs亚洲vs韩国一区三区| 伊人婷婷欧美激情| 日韩毛片精品高清免费| 国产日韩三级在线| 精品国产乱码久久久久久夜甘婷婷 | 在线观看www91| 成人午夜精品一区二区三区| 捆绑调教美女网站视频一区| 香蕉久久夜色精品国产使用方法| 亚洲日本在线视频观看| 国产精品视频一二三| 久久精品这里都是精品| 精品久久人人做人人爱| 日韩三级免费观看| 日韩欧美第一区| 日韩三级精品电影久久久 | 欧美精品一区二区在线观看| 欧美欧美午夜aⅴ在线观看| 欧美午夜精品久久久久久孕妇| 99久久久无码国产精品| 91亚洲精品久久久蜜桃网站 | 欧美日韩大陆一区二区| 在线观看网站黄不卡| 欧美中文字幕一区二区三区亚洲| 91久久精品日日躁夜夜躁欧美| 972aa.com艺术欧美| 波多野洁衣一区| 色婷婷久久久综合中文字幕| 成人网男人的天堂| 成人18精品视频| 99精品视频一区二区三区| 99热精品国产| 在线欧美一区二区| 8v天堂国产在线一区二区| 日韩一区二区三区av| 精品日韩欧美在线| 久久精品视频在线看| 国产精品欧美一级免费| 亚洲精品乱码久久久久久黑人 | 国产亚洲一二三区| 国产精品久久久久久久第一福利 | 国产很黄免费观看久久| 北条麻妃一区二区三区| 日本高清不卡视频| 欧美精品久久一区| 2023国产精华国产精品| 国产精品欧美一级免费| 亚洲国产成人精品视频| 精品一区二区三区香蕉蜜桃 | wwwwww.欧美系列| 日韩伦理av电影| 免费欧美在线视频| 国产69精品久久777的优势| 99riav一区二区三区| 欧美喷潮久久久xxxxx| 久久久久97国产精华液好用吗| 亚洲欧美另类综合偷拍| 欧美aa在线视频| 99久久国产免费看| 日韩三级.com| 亚洲免费在线看| 久久av资源站| 色八戒一区二区三区| 日韩欧美在线一区二区三区| 国产精品二三区| 蜜臀av一区二区| 91一区在线观看| 久久婷婷综合激情| 亚洲成人免费影院| www.激情成人| 精品国产一区二区三区不卡| 夜夜精品浪潮av一区二区三区| 青青青爽久久午夜综合久久午夜| 99久久伊人网影院| 精品日韩在线一区| 亚洲地区一二三色| thepron国产精品| 久久久午夜精品| 日韩综合一区二区| 日本久久一区二区| 国产精品丝袜91| 国内国产精品久久| 欧美午夜精品久久久久久孕妇| 国产精品丝袜久久久久久app| 免费成人小视频| 欧美色中文字幕| 亚洲天堂成人网| 2023国产精华国产精品| 国产精品夜夜嗨| 欧美群妇大交群中文字幕| 国产区在线观看成人精品 | 亚洲一区在线观看免费 | 爽好久久久欧美精品| 色综合视频一区二区三区高清| 久久久不卡网国产精品一区| 蜜桃久久久久久| 欧美日韩免费电影| 一区二区三区高清在线| 91丨porny丨户外露出| 欧美国产国产综合| 国产乱人伦精品一区二区在线观看| 制服丝袜一区二区三区| 午夜精品久久久久久久久| 色综合久久综合中文综合网| 国产精品美女久久久久aⅴ | 欧美日韩精品一区二区天天拍小说| 日韩一区在线播放| www.欧美日韩国产在线| 国产精品欧美久久久久一区二区| 国产精品亚洲一区二区三区在线 | 国产欧美日韩精品一区| 国产真实乱对白精彩久久| 日韩欧美国产高清| 久久99精品久久久久久久久久久久| 欧美群妇大交群中文字幕| 日本v片在线高清不卡在线观看| 欧美精品久久一区| 麻豆精品新av中文字幕| 久久这里只有精品视频网| 国产剧情一区在线| 国产精品伦理一区二区| 9久草视频在线视频精品| 亚洲人妖av一区二区| 欧美在线观看一区| 日韩二区在线观看| 亚洲精品在线免费播放| 国产成人精品亚洲日本在线桃色| 久久久五月婷婷| 成人开心网精品视频| 亚洲欧美一区二区三区极速播放 | 国产精品素人视频| 91一区一区三区| 亚洲18色成人| 欧美成人aa大片| 成人av在线资源网站| 亚洲精品成人悠悠色影视| 欧美在线视频你懂得| 老司机一区二区| 国产午夜精品一区二区三区视频 | 风间由美一区二区三区在线观看| 国产精品国产三级国产aⅴ原创| 色婷婷久久99综合精品jk白丝| 亚洲成av人片在www色猫咪| 欧美不卡一区二区三区四区| 高清在线成人网| 午夜久久久久久久久久一区二区|