29 #include "../precompiled.h"
40 const int MT = 10, MAX_ITERATIONS = MT * 8;
41 static const float frac[] = { 0.0f, 0.5f, 0.25f, 0.75f, 0.13f, 0.38f, 0.62f, 0.88f, 1.0f };
43 float abx, abp, abm,
err;
46 for ( i = 1; i <= MAX_ITERATIONS; i++ ) {
52 for ( j = degree - 1; j >= 0; j-- ) {
63 s = ( ( degree - 1 ) * ( degree * ( g2 - 2.0f * f / b ) - g2 ) ).
Sqrt();
71 if (
Max( abp, abm ) > 0.0f ) {
99 for ( i = 0; i <=
degree; i++ ) {
103 for ( i =
degree - 1; i >= 0; i-- ) {
111 for ( j = i; j >= 0; j-- ) {
118 for ( i = 0; i <=
degree; i++ ) {
121 for ( i = 0; i <
degree; i++ ) {
122 Laguer( coef, degree, roots[i] );
125 for ( i = 1; i <
degree; i++ ) {
127 for ( j = i - 1; j >= 0; j-- ) {
128 if ( roots[j].
r <= x.
r ) {
131 roots[j+1] = roots[
j];
165 for ( num = i = 0; i <
degree; i++ ) {
166 if ( complexRoots[i].i == 0.0
f ) {
167 roots[
i] = complexRoots[
i].
r;
190 float roots[4],
value;
196 for ( i = 0; i <
num; i++ ) {
203 for ( i = 0; i <
num; i++ ) {
210 for ( i = 0; i <
num; i++ ) {
217 for ( i = 0; i <
num; i++ ) {
224 for ( i = 0; i <
num; i++ ) {
231 for ( i = 0; i <
num; i++ ) {
232 complexValue = p.
GetValue( complexRoots[i] );
238 for ( i = 0; i <
num; i++ ) {
239 complexValue = p.
GetValue( complexRoots[i] );
GLsizei const GLfloat * value
assert(prefInfo.fullscreenBtn)
static int GetRoots1(float a, float b, float *roots)
static float Log(float f)
ID_INLINE T Max(T x, T y)
float GetValue(const float x) const
static const char * FloatArrayToString(const float *array, const int length, const int precision)
static int GetRoots2(float a, float b, float c, float *roots)
int GetDimension(void) const
idComplex Sqrt(void) const
static int GetRoots3(float a, float b, float c, float d, float *roots)
const float * ToFloatPtr(void) const
static float Sin(float a)
static float Fabs(float f)
int GetRoots(idComplex *roots) const
static float Exp(float f)
const char * ToString(int precision=2) const
static int GetRoots4(float a, float b, float c, float d, float e, float *roots)
int Laguer(const idComplex *coef, const int degree, idComplex &r) const
GLdouble GLdouble GLdouble r
static WindowRef ValidModeCallbackProc inCallback OSStatus err
void Set(const float r, const float i)
static float Cos(float a)