I'm posting here on trux' invitation
I have a new idea to increase seti client speed. I've tested it on my MSVC++ but it's not an Intel...
So if someone wants to test...
Hans Dorn had the idea to cache sin/cos results. My idea is also to work on sin/cos functions, but by pre-calculated 10000 values in an array and extract results from this array.
In main.cpp, add this following lines in global variables field:
Kód: Vybrat vše
float cosTable[10240];
float sinTable[10240];Kód: Vybrat vše
int i;
float j;
for (i=0 ; i<10240 ; i++) {
j = (float)0.00030679616 * (float)i; // 0.00030679616 is PI/10240
cosTable[i] = cos(j);
sinTable[i] = sin(j);
}Kód: Vybrat vše
angle /= (float)3.141593; // PI
if (angle >= 0) {
angle -= int(angle);
angle = angle * 10240.0 + 0.5;
*s = sinTable[(int)angle];
*c = cosTable[(int)angle];
} else {
angle *= -1.0;
angle -= int(angle);
angle = angle * 10240.0 + 0.5;
*s = -sinTable[(int)angle];
*c = cosTable[(int)angle];
}The number of 10240 values could be adjust by tests.
