Solved by ptrblck in post #5 
              
              
                Just for the same of debugging, I would split the pow operations, which are applying a root to the input, and add an assert statement for the input to check for negative values.