RT-AICHIPV3-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)
 

マクロ定義詳解

◆ INVSQRT_NEWTON_METHOD_NUM

#define INVSQRT_NEWTON_METHOD_NUM   (2)

関数詳解

◆ quickSort()

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

クイックソートの実装

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

◆ tInvSqrt()

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の値

◆ tSqrt()

float tSqrt ( float  x)

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

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