how about this:
day 0: arriving at Madrid in the afternoon, walk around the city.
day 1: see madrid
day 2: see Toledo
day 3: take AVE to Sevilla, spend the day and night.
day 4: take AVE back to madrid, go to Segovia
day 5: madrid. leaving in the evening to Barcelona.
what do you think?