} else if (type.getPrimitiveTypeName().equals(Type.TypeName.DOUBLE)) {
bucket.setState(state.doubleValue() + num.doubleValue());
} else if (type.getPrimitiveTypeName().equals(Type.TypeName.PRECISE)) {
bucket.setState(((BigDecimal) state).add((BigDecimal) num));
} else {
throw new EvalException("Cannot take sum over type: " + num.getClass().getName());
}
}