In DM, at least, the answer is no.
To test and verify this, after Kaiochao remarked on his surprise when he was doing testing, I used code similar to the following:
#define DEBUG
mob
var
list/data
verb
Populate()
set background = 1
data = new
for(var/i = 1 to 300000)
data += rand(1, 1000)
world << "Done."
Test_StoreAndMultiply()
var
s
b1;b2
len = data.len
for(var/i = 1 to len step 3)
s = data[i]
b1 = data[i+1]
b2 = data[i+2]
s = 1 / s
b1 *= s
b2 *= s
Test_Divide()
var
s
b1;b2
len = data.len
for(var/i = 1 to len step 3)
s = data[i]
b1 = data[i+1]
b2 = data[i+2]
b1 /= s
b2 /= s
with (horribly ugly) metacode to generate it found here.
Using this, I generate the following data for n = 2, 3, 5, 7, 9, 11, 25, and 40.
/*
n = 2
Profile results (average time)
Proc Name Self CPU Total CPU Real Time Calls
------------------------------- --------- --------- --------- ---------
/mob/verb/Test_StoreAndMultiply 0.115 0.115 0.115 5
/mob/verb/Test_Divide 0.098 0.098 0.098 5
n = 3
Profile results (average time)
Proc Name Self CPU Total CPU Real Time Calls
------------------------------- --------- --------- --------- ---------
/mob/verb/Test_StoreAndMultiply 0.140 0.140 0.140 5
/mob/verb/Test_Divide 0.124 0.124 0.124 5
n = 5
Profile results (average time)
Proc Name Self CPU Total CPU Real Time Calls
------------------------------- --------- --------- --------- ---------
/mob/verb/Test_StoreAndMultiply 0.199 0.199 0.199 5
/mob/verb/Test_Divide 0.181 0.181 0.181 5
n = 7
Profile results (average time)
Proc Name Self CPU Total CPU Real Time Calls
------------------------------- --------- --------- --------- ---------
/mob/verb/Test_StoreAndMultiply 0.249 0.249 0.249 5
/mob/verb/Test_Divide 0.231 0.231 0.231 5
n = 9
Profile results (average time)
Proc Name Self CPU Total CPU Real Time Calls
------------------------------- --------- --------- --------- ---------
/mob/verb/Test_StoreAndMultiply 0.316 0.316 0.316 5
/mob/verb/Test_Divide 0.298 0.298 0.298 5
n = 11
Profile results (average time)
Proc Name Self CPU Total CPU Real Time Calls
------------------------------- --------- --------- --------- ---------
/mob/verb/Test_StoreAndMultiply 0.386 0.386 0.386 5
/mob/verb/Test_Divide 0.370 0.370 0.371 5
n = 25
Profile results (average time)
Proc Name Self CPU Total CPU Real Time Calls
------------------------------- --------- --------- --------- ---------
/mob/verb/Test_StoreAndMultiply 0.774 0.774 0.774 5
/mob/verb/Test_Divide 0.748 0.748 0.748 5
n = 40
Profile results (average time)
Proc Name Self CPU Total CPU Real Time Calls
------------------------------- --------- --------- --------- ---------
/mob/verb/Test_StoreAndMultiply 1.184 1.184 1.184 5
/mob/verb/Test_Divide 1.143 1.143 1.143 5
*/
A quick summary of the data is that in each of the cases for n = 2, 3, 5, 7, 9, 11, 25, and 40, dividing each time rather than multiplying by the inverse gets a speed improvement of 0.017, 0.016, 0.018, 0.018, 0.018, 0.016, 0.026, and 0.041 seconds respectively. While the results appear non-linear (it could be linear with the non-linearity being from random chance), it appears that repeated division gives you better gains as n increases. Obviously without further understanding of why this occurs I can't do much but extrapolate, as I have here, but it certainly appears that it's always better to do repeated division rather than pre-computing an inverse.
Anyone have insights into why this would be the case?