lx norm as C implementation