#include <oxstd.h>

#include <lib/acffft.ox>

main()
{
	decl ct = 7001, cacf = 1004, y, macf1, macf2, cmin;

	y = rann(ct, 2);

	decl time = timer();
	macf1 = acf(y, cacf-1);  
	print("Time for acf:    ", timespan(time), "\n");

	time = timer();
	macf2 = AcfFft(y, cacf-1);
	print("Time for AcfFft: ", timespan(time), "\n");

  	                      /* acf() will not produce more than rows(y) ACF's */
	cmin = min(rows(macf1), rows(macf2)) - 1;
	print("maximum difference ", max(fabs(macf1[:cmin] - macf2[:cmin])));
}
