ksdiff: add formula