Thanks for respond Dan. Reading the article You quoted I understood where is the problem in my expression. I didn't know that I can't use "speed" word as variable name. Since I change it to "spd" shortcut expression started to work.
Indeed it's a bit complicated to control acceleration and deceleration but until you want to control constant speed, e.g. by slider control, it's easy as my expression ;)