基于DSP开发平台《TI DSP在音频处理中的应用》程序代码
源代码在线查看: example 2-16.c
/* Example 2 - 16. Single-Precision Floating-Point Square Root C Listing for sqrtf */
/***************************************************************/
/* SQRSPC.c Syd Poland 6-06-98 _sqrtf function in C for 'C67xx */
/***************************************************************/
float sqrtf(float A)
{
float ZERO=0.0, HALF=0.5, K15=1.5, AH, X0, X1, X2, Y ;
if (A < ZERO) A = -A ; /* square root of absolute A */
AH = A * HALF ;
X0 = _rsqrsp(A) ;
X1 = X0 * ( K15 - AH*X0*X0 ) ;
X2 = X1 * ( K15 - AH*X1*X1 ) ;
Y = A * X2 ;
return (Y) ;
}