Actually for the test to be (more) fair, sin and cos takes a floating point parameter while an array takes an integer. Therefore the values passed to them should be in the right format to avoid converting from float to int or vice versa.
Local pcos#[360] Local psin#[360] For x = 0 To 359 pcos[x] = Cos(x) psin[x] = Sin(x) Next sec = MilliSecs() For x = 0 To 60000 n# = pcos[Rand(0,359)]/psin[Rand(0,359)]*pcos[Rand(0,359)]/psin[Rand(0,359)]+pcos[Rand(0,359)]/psin[Rand(0,359)]/pcos[Rand(0,359)]/psin[Rand(0,359)] Next lapse = MilliSecs() - sec Print lapse sec = MilliSecs() For x = 0 To 60000 n# = Cos(Rnd(0.0,359.0))/Sin(Rnd(0.0,359.0))*Cos(Rnd(0.0,359.0))/Sin(Rnd(0.0,359.0))+Cos(Rnd(0.0,359.0))/Sin(Rnd(0.0,359.0))/Cos(Rnd(0.0,359.0))/Sin(Rnd(0.0,359.0)) Next lapse = MilliSecs()-sec Print lapseThis on average gives 77ms vs. 97ms on my laptop. But if you have something that takes less than 100 millisecs to do 480008 calculations/lookups, there is absolutely no point in optimizing, unless you will be using it excessively. Especially when you consider that you've effectively lost a lot of precision by using a lookup.