2010-08-16, 07:40 AM
I think your questions are better asked and answered on a TI developer forum, but I'll try my best...
2147483647 Wrote:Sorry. I didn't really understand that article. Here are the tables:Truthfully, I don't know. It all depends on TI's compiler and the CPU architecture. But the best I can think of is:
Format Bars Pixels Total A/B 20 6 166 AB^-1 28 2 226
Format Bars Pixels Total 1/B, when B=1 15 0 120 B^-1, when B=1 14 1 113 1/B, when B=pi 20 2 162 B^-1, when B=pi 19 2 154
How come in the first table, ^-1 worked really slowly, but in the second, it worked faster?
- In Table 1, case 2: the compiler/CPU is thinking of it as two operations going on instead of just one (e.g., take inverse of B -> now multiply A and B's inverse).
2147483647 Wrote:Also, it's probably not the case, but what if A=1 in the first table?Again, I don't know. This is something you should actually test. It's possible that it will run slower because it needs to access the variable in memory -- there is going to be some kind of overhead for using a variable instead of a constant. I think it would take a lot of loops to cause a significant real world impact on performance though.
2147483647 Wrote:I thought in a complex equation, the program groups each portion as a separate entity. How else would it account for operations grouped together with parentheses, like in the following example:Yes, it should apply order of operations correctly. 1) X+Y, 2) take the inverse of the result of 1, and 3) A multiplied by the result of 2.
A(X+Y)^-1

