include "test.idp" cout << functionDEFINITION << "log" << endl; real t; cout << typeDEFINITION << "real" << endl; real r = 4.2; real minf = log(0.); real pinf = -log(0.); t = clock(); real resr = log(1.); t = clock() - t; cout << timeELAPSED << t << endl; test(resr == 0.); t = clock(); real rminf = log(0.); t = clock() - t; cout << timeELAPSED << t << endl; test(rminf == minf); t = clock(); real rpinf = log(pinf); t = clock() - t; cout << timeELAPSED << t << endl; test(rpinf == pinf); cout << typeDEFINITION << "complex" << endl; complex cpos = 4. + 2.i; complex cneg = 4. - 2.i; t = clock(); complex rescpos = log(cpos); t = clock() - t; cout << timeELAPSED << t << endl; test(rescpos == log(abs(cpos)) + 1i * arg(cpos)); t = clock(); complex rescneg = log(cneg); t = clock() - t; cout << timeELAPSED << t << endl; test(rescneg == log(abs(cneg)) + 1i * arg(cneg));