Looks like the script was made by this guy http://nerget.com/
I've done more serious touching of it, for performance reasons -- taking mults and invariants out of loops, or memoizing for example -- but I always ended up either breaking it or making it slower, so for now I've settled with leaving it alone!
http://www.dgp.toronto.edu/people/stam/reality/Research/pdf/...
I was surprised to see not just equations but actual C code -- a pretty readable paper.