ToleranceFactor computes the exact tolerance factor for the twosided tolerance interval
ToleranceFactorGK computes (by the GaussKronod quadrature) the exact tolerance factor k for the twosided (optionally for the onesided) pcontent and (1alpha)confidence tolerance interval TI = [Xmean  k * S, Xmean + k * S], where Xmean = mean(X) and S = std(X), are based on X = [X_1,...,X_n], a random sample
of size n from the distribution N(mu,sig2) with unknown mean mu and variance sig2.
ToleranceFactor computes the exact tolerance factor k for the twosided (optionally also for the onesided) pcontent and gammaconfidence tolerance interval
TI = [Xmean  k * S, Xmean + k * S],
where Xmean = mean(X), S = std(X), X = [X_1,...,X_n] is a random sample from the distribution N(mu,sig2) with unknown mean mu and variance sig2.
The value of the tolerance factor k is determined such that the tolerance intervals with the confidence gamma cover at least the fraction p ('coverage') of the distribution N(mu,sigma^2), i.e.
Prob[ Prob( Xmean  k * S < X < Xmean + k * S ) >= p ]= gamma,
for X ~ N(mu,sig2) which is independent with Xmean and S. For more details see e.g. Krishnamoorthy and Mathew (2009).
Syntax:
k = ToleranceFactorGK(n,coverage,confidence)
or
[k,int,z,fun,options] = ToleranceFactorGK(n,coverage,confidence,m,nu,d2,options)
References:
ISO 162696 (2013). Statistical interpretation of data  Part 6: Determination of statistical tolerance intervals.
Krishnamoorthy K, Mathew T. (2009). Statistical Tolerance Regions: Theory, Applications, and Computation. John Wiley & Sons, Inc., Hoboken, New Jersey. ISBN: 9780470380260, 512 pages.
Witkovsky V. (2013). On the exact tolerance intervals for univariate normal distribution. In: Proceedings of Computer Data Analysis & Modeling – CDAM2013, Minsk, Belarus, September 1014, 2013.
Viktor Witkovsky
Institute of Mesaurement Science
Slovak Academy of Sciences
Dubravska cesta 9
84104 Bratislava
Slovak Republic
Email: witkovsky@savba.sk
http://www.um.sav.sk/en/department03/viktorwitkovsky.html
1.4  ToleranceFactorGK uses adaptive GaussKronod quadrature. Moreover, allows computing tolerance factor for simultaneou tolerance intervals, based on sample from m populations with common sample size n. 

1.2  Speed 

1.1  Fisrst revision, 20090517 
Viktor Witkovsky (view profile)
@Pete: The presented result of ToleranceFactorGK(30,.95,.95) = 2.5549 (2.554892813277693) is in good agreement with the factor K = 2.555 from Table B2 in Krishnamoorthy & Mathew (2009, p. 368), as well as with the numerical output of R package tolerance:
K.factor(30, P = 0.95, side = 2, method = "EXACT", m = 50) = 2.554893.
The problem with many other sources is that they are based either on approximations or on not well documented method/algorithm.
Pete (view profile)
Prima facie, this looks well written and well documented. It seems to give results that are highly correlated with, but slightly from, various websites (all of which agree with each other). For example:
>> ToleranceFactorGK(30,.95,.95)
ans = 2.5549
Whereas the following all give it as 2.549
 http://statpages.org/tolintvl.html
 http://www.astm.org/standardizationnews/datapoints/statisticalintervalspart3nd11.html
 http://www.webapps.cee.vt.edu/ewr/environmental/teach/smprimer/intervals/interval.html
The difference is small though, particularly at large N, and any fault may lie with the websites rather than this function (unsure). Any explanation for this difference would be much appreciated.
Thanks for posting