ARIADNE is a package of two programs, ariadne and prospero, that compare protein sequences and profiles using the Smith-Waterman algorithm, and assesses statistical significance using a new accurate formula, described in Mott, 2000, "Accurate Formula for P-values of gapped local sequence and profile alignments" J. Mol Biol. 300:649-659 [link to JMB] .
The sequence/profile comparison algorithms used in ARIADNE are standard, and are probably not the fastest implementations available. The novel part is the method for determining statistical significance, which will give thresholds of significance that are accurate to within 5% 95% of the time.
The package is written in ANSI C. You are free to incorporate the method used for assessing statistical significance into third-party code, provided you cite the above reference. The routines for assessing significance are all in gaplib.c
NEW Several people have asked for a PDF of my paper Mott (1992) Maximum Likelihood estimation of the statistical distribution of Smith-Waterman local sequence similarity scores Bull. Math. Biol 54: 59-75.. Here it is (warning: it is scanned from a photocopy, so is both huge (29Mb) and low-resolution)
NEW Also there have been a number of requests for the paper Mott and Tribe (1999) Approximate Statistics of Gapped Alignments, J Comput. Biol. 6:91-112. Here is a scanned PDF.