Might want to raise a warning here, Maybe even an error, In any case, dividing a non-zero constant by 1e-20 is probably the wrong thing to do. Also, in whitening time series for observations from differenct insturments or proxies, it is common to demean them first, so it might be good to offer that as an option and if the series are demeaned and the stddev is zero, just divide by one.