Question: is it better to set the values to (-1.0,1.0) or to raise some kind of value error.
I'm not sure how often this occurs or under what circumstances. If it's a round-off correction thing, then this makes sense, but if it's more to hammer things that are really out-of-range due to other problems back in range so that you don't get NaNs from other functions, this feels wrong to me.