The line below `if l < 0: ...` needs to be written in a vector-safe way like in the forward transform.