OK, for this one time

a= ((a*(5.0 / 1024)) - 1.375) / 0.0225;

<==>

a = ((a*(5.0 / 1024)) - 1.375) * 44.4444444444; // as 1/0.0225 = 44.4444444..;

<==>

a = (a*(5.0 / 1024)) * 44.4444444444 - 1.375 * 44.4444444444; // distribute the multiplication;

<==>

a = (a*(5.0 / 1024)) * 44.4444444444 - 61.11111111;

<==>

a = a * (0.004882812) * 44.4444444444 - 61.11111111;

<==>

a = a * 0.217226044 - 61.1111111;

119

161

120.

means

- an analogRead takes about 119 microsec [OK]

- the original formula takes 161 - 119 micros() = 42 microsec; [OK]

- the optimized formula takes 120-119 micros() = 1 microsec;

I cannot believe the last measurement, seems to be optimized away

rewritten the last loop to

for (int i=0; i<1000; i++)

{

raw = analogRead(A0);

raw = raw * 0.217226044 - 61.1111111;

}

gives

119

162

128 ==> 9 micros for the formula

So the new formula drops factor 4 by going from 4 to 2 Floating Point operations (esp removing divisions)