Since I'm a sci-fi geek, I'm thinking of the velocity of a starship as it travels to its destination under constant (say, 1g) acceleration. The idea is that you reach your highest velocity at the halfway point, then turn around, and start decelerating.
So:
halfway = distance / 2
velocity = 0
counter = 0
accelerationfactor = 1
while (counter < distance)
if (counter > halfway AND accelerationfactor > 1)
accelerationfactor = accelerationfactor * -1 // turnaround
velocity += accelerationfactor
counter += velocity
You'll need to clean up for overshooting, but I think that should pretty much do what you want.
EDIT: re-reading your question, your linked image doesn't look like what you've described textually. The algorithm I've outlined will give you the linked image. But if you want to start from "high speed" and just decelerate, then either do the geometric algorithm that Deozaan gives, or
velocity = 100 // or whatever
acceleration = 1
counter = 0
while (counter < target)
velocity -= acceleration
counter += velocity