According to [this SO question](http://stackoverflow.com/questions/18729323/unsequenced-modification-and-access-to-parameter) the problem is the assignment operation `t=t/d-1` in the middle of a calculation. Removing that to a separate statement creates the proper sequencing to allow a calculation with entirely deterministic values.