Using in here an 'np.abs(data) < rtol * infinity_norm' would be more memory friendly for two reasons. First you would avoid having two temporary buffers and you would have only one. Second, it would be garbage collected very quickly, whereas here you have to wait for the function to exit to have garbage collection kick in.