On the computation of pfaffians