Calculate statistics of a sequence iteratively in a single pass, using constant memory and avoiding numerical problems. The calculations can be easily parallelized by using merge.
merge