RT-AICHIP-sample
tinyMathFunctions.c ファイル
#include "type.h"
#include "tinyMathFunction.h"
tinyMathFunctions.c の依存先関係図:

[ソースコード]

マクロ定義

#define INVSQRT_NEWTON_METHOD_NUM   (2)
 

関数

float tInvSqrt (float x)
 
float tSqrt (float x)
 
void quickSort (int numbers[], int left, int right)
 

マクロ定義詳解

#define INVSQRT_NEWTON_METHOD_NUM   (2)

tinyMathFunctions.c12 行目に定義があります。

関数詳解

void quickSort ( int  numbers[],
int  left,
int  right 
)

クイックソートの実装

引数
numbers[]配列
leftクイックソートする区間の左端
rightクイックソートする区間の右端
戻り値
acosの値

tinyMathFunctions.c79 行目に定義があります。

被呼び出し関係図:

float tInvSqrt ( float  x)

高速なinvSqrt(x)の実装.
ニュートン法を一回実行するごとにfloatの乗算が3回必要
INVSQRT_NEWTON_METHOD_NUMでニュートン法の適用回数を決める
math.hのsqrt()に対して
0:誤差は ±0.05以下
1:誤差は ±0.005以下
2:誤差は ±0.000005以下
3:誤差は ほぼなし

引数
x定義域は[-1.0,1.0]
戻り値
acosの値

tinyMathFunctions.c26 行目に定義があります。

float tSqrt ( float  x)

高速なsqrt(x)の実装.
invSqrt(x)*xでsqrt(x)を計算
invSqrt(x)のニュートン法ステップ3回でほぼ誤差なしになる.

引数
x定義域は[-1.0,1.0]
戻り値
acosの値

tinyMathFunctions.c47 行目に定義があります。

被呼び出し関係図: