Allen wrote this (ported it from the actual easing tweening equation guy from whatever language to C)
But I use this a lot, so I'm putting it here on gist.