Evolution is a closed stochastic optimisation process driven by the interaction between behaviour and environment towards local maxima in fitness. It is inferred that nervous systems are selected to provide optimal control of behaviour (the 'assumption of optimality'), such that for some behaviours, the expectation of future hazards to survival are minimised. This is illustrated by goal-directed saccades in which minimising total flight-time of primary and secondary movements provides a better fit to observations than simply minimising the error of the primary movement. This optimisation is extended to intra-movement trajectories, where low-bandwidth (smooth) velocity profiles provide a more satisfactory description of observations than simple bang-bang control. Since minimum-time behaviours cannot be controlled by error feedback, it is concluded that the cerebellum must be executing a real-time unreferenced optimisation process. This requires explorative as well as exploitative behaviour. Stochastic gradient descent is discussed as a possible means by which the cerebellum may optimise behaviour.