This file contains screen output from a short demo session and a timing comparison of the C and R versions. % R R : Copyright 2004, The R Foundation for Statistical Computing Version 1.9.1 (2004-06-21), ISBN 3-900051-00-3 ... > source('pava.r') # load the C version > source('rpava.r') # load the R version > k = 1000 > y1k = runif(k) > max(abs(pava(y1k) - rpava(y1k))) # compare results [1] 2.514655e-14 > system.time(rpava(y1k)) # time the R code with n = 1K [1] 3.43 0.07 8.72 0.00 0.00 > system.time(pava(y1k)) # time the C code with n = 1K [1] 0 0 0 0 > y100k = runif(100*k) > system.time(pava(y100k)) # time the C code with n = 100K [1] 0.37 0.01 1.20 0.00 0.00