pub fn scale(state: &State, factor: f64) -> State
Returns a new state with all values multiplied by factor.