changing testdirect to use relative error instead of absolute