correctly compute sw_trace_nd

Also, remove if test in sw_trace to gain alittle bit of performance. In addition, the documentation for these sections is updated accordingly.
Your're right, this should be made explicit! The imaginary part of eiher ```det``` is probably very close to 0 so what will end up in ```tra``` is probably very close to the correct result, but still!