SML implementation of a memoized integral evaluator