Fix a numeric stability problem in rollsd()