Hi to all,

i’m new to the forum (and arduino :)) i’m trying to create a library that use Look Up Table to calculate sin/cost faster (with loss precision, of course). I’ve seen that this is a common topic but, my problem is to calculate the real time that sin/cos standard consume, and i get strange result.

This is my code where i simply initialize an array with 100 value and make a 1000 * 100 calculation (just to consume less memory and make more calc).

If multiplier is 100, 1000 or 10000 i got even the same result:

Std: 0.0000040000

I really can’t understand why…

In this way, i cant test if my sin/cos that use LUT, will be faster or not… where i wrong ?

Thanks a lot for your patience!

```
#define SIN_ARR_SIZE 100
#define MULTIPLIER 10000
float testSinStd() {
float tmp = 0.0;
unsigned long startTime, endTime;
startTime = micros();
for (int j = 0; j < MULTIPLIER; j++) {
for (int i = 0; i < SIN_ARR_SIZE; i++) {
sin(sin_seeds[i]);
}
}
endTime = micros();
return (endTime - startTime) / 1000000.0f;
}
void setup() {
Serial.begin(9600);
// Populate sin value
for (int i = 0; i < SIN_ARR_SIZE; i++) {
sin_seeds[i] = random(0, 4* PI);
}
Serial.print("Std: ");
Serial.println(testSinStd(), 10);
}
```